Javascript auto click button on page load

We taking about auto click on button on page load or any kind of event, then JavaScript will work here. Using this we can operate PHP as well as any Server-Side language but we must be use JavaScript or its Libraries.

Script for javascript auto click button on page load

<!DOCTYPE html>
<html>
<body>

<input type="text" value="0" id="count_id">

<input type="button" value="Click Me" id="button_id" onclick="myFunction()">

<script>
function myFunction() {
	
	var data = document.getElementById("count_id").value;
	var  datacount = (parseInt(data) + 1);
	document.getElementById("count_id").value = datacount;	
	document.getElementById("button_id").value = "Clicked";
	
}
setInterval(function(){
document.getElementById("button_id").click();	
}, 3000);
</script>

</body>
</html>

Result of above program

automatically clicking on button
automatically clicking on button – 1
automatically clicking on button
automatically clicking on button 2