html button method code example
Example 1: button functions html
<script>
function myFunction() {
alert("ALERT");
}
</script>
<button onclick="myFunction">Click</button>
Example 2: button in html
<button></button>
<script>
function myFunction() {
alert("ALERT");
}
</script>
<button onclick="myFunction">Click</button>
<button></button>