html button function site:w3schools.com code example
Example 1: javascript onclick
document.getElementById("myBtn").addEventListener("click", function() {
alert("Hello World!");
});
Example 2: how to make a button in javascript
<button id="btn">button</button>