Answers for "creating a button in html"

2

creating a button in html

<!-- html button tag example -->
<button type="button">Click Me!</button>

<!-- html example code for button -->
<html>
  <head>
    <title>Example Button Code</title>
  </head>
  
  <body>
    <button onclick="buttonFunction()">Click Me!</button>
    
    <script>
      function buttonFunction() {
        console.log("This function is called when the button is pressed");
      }
    </script>
    
  </body>
</html>
Posted by: Guest on September-25-2021

Browse Popular Code Answers by Language