Click counter HTML Code

PROGRAMMED BY DEVANSH MISHRA 
<html> 
<body>

<script>

 var clicks = 0; 
 function onClick() 
 {
clicks += 1; 
document.getElementById("clicks").innerHTML = clicks; 
 };
  
</script> 

<div align="center">

<button type="button" onClick="onClick()">
Click me
</button> 
<p>Clicks: <a id="clicks">0</a></p>

</div>
</body>
</html>

Comments

Popular posts from this blog

SWAG ANIMATION WITH SOUND

Chandrayan 3 Mission Special :Animation

Python Basic Programs By Devansh Mishra.