how to use input tag in html to call a function on click code example
Example 1: button functions html
<script>
function myFunction() {
alert("ALERT");
}
</script>
<button onclick="myFunction">Click</button>
Example 2: javascript onclick
var myElem = document.getElementByID('ElemID');
myElem.onclick = function() {
//do stuff
}