Answers for "button click javascript html"

1

how to call a function with a button in javascript

<script>
		function myFunction()
		{
			document.write("<h1>HELLO</h1>")
		}
	</script>
<button onclick="myFunction()">Click</button>
Posted by: Guest on November-12-2020
1

javascript button onclick

document.getElementById('button').onclick = function() {
   alert("button was clicked");
};
Posted by: Guest on May-09-2020

Code answers related to "button click javascript html"

Code answers related to "Javascript"

Browse Popular Code Answers by Language