onlcik and event handler javascript w3schools code example
Example 1: button click function in js
<script>
$(document).ready(function(){
$('#MyButton').click(function(){
CapacityChart();
});
});
</script>
<input type="button" value="Capacity Chart" id="MyButton" >
Example 2: calling function on click html
<img src="hospital.png" id="hospitals" onclick="damarkers();">