Q:

calling function on click html

<button onclick="myFunction()">Click me</button>

<p id="demo"></p>

<script>
function myFunction() {
  document.getElementById("demo").innerHTML = "Hello World";
}
</script>
9
var myElem = document.getElementByID('ElemID');
myElem.onclick = function() {
	//do stuff
}
10
<button onClick="script">
2
  <img src="hospital.png" id="hospitals" onclick="damarkers();">
-1

New to Communities?

Join the community