<script> function myFunction() { alert("ALERT THIS FUNCTION HAS RUNNED"); } </script> <button onclick="myFunction">click to run function</button>
document.getElementById("Save").onclick = function () { alert("hello"); //validation code to see State field is mandatory. }
var element = document.getElementById("elem"); element.onclick = function(event) { console.log(event); }
<script> function myFunction() { alert("ALERT"); } </script> <button onclick="myFunction">Click</button>
<img src="hospital.png" id="hospitals" onclick="damarkers();">