Check out example codes for "button tag in html". It will help you in understanding the concepts better.

Code Example 1

<html>
  <head>
    <title>Buttons</title>
  </head>
  
  <body>
    <button onclick = "myfunction()">button</button>
    
    <script>
      function myfunction() {
        console.log("This is a working button");
      }
    </script>
    
  </body>
</html>

Code Example 2

<button type="button">Click Me!</button>

Code Example 3

<button>I'm a button</button>

Code Example 4

<button type="button">Click Me!</button>

Code Example 5

<button type="button" onclick="alert('You pressed the button!')">Click me!</button>

Code Example 6

<button type="button"> This is a button</button>
<button type="submit"> This is a submit button (used in forms)</button>
<button type="reset"> This is a reset button (used in forms)</button>

Learn ReactJs, React Native from akashmittal.com