creating a button in html

Solutions on MaxInterview for creating a button in html by the best coders in the world

showing results for - "creating a button in html"
Matilda
17 Aug 2020
1<!-- html button tag example -->
2<button type="button">Click Me!</button>
3
4<!-- html example code for button -->
5<html>
6  <head>
7    <title>Example Button Code</title>
8  </head>
9  
10  <body>
11    <button onclick="buttonFunction()">Click Me!</button>
12    
13    <script>
14      function buttonFunction() {
15        console.log("This function is called when the button is pressed");
16      }
17    </script>
18    
19  </body>
20</html>