javascript onclick
document.getElementById("myBtn").addEventListener("click", function() {
alert("Hello World!");
});
clicca su un tag
<a href='http://www.google.com' onclick='return check()'>check</a>
<script type='text/javascript'>
function check() {
return false;
}
</script>
come aggiungere evento onclick in javascript
var element = document.getElementById("elem");
element.onclick = function(event) {
console.log(event);
}
funzione di chiamata al clic html
<img src="hospital.png" id="hospitals" onclick="damarkers();">