Answers for "html button to call javascript function"

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
7

onclick a tag

<a href='http://www.google.com' onclick='return check()'>check</a>

<script type='text/javascript'>
function check() {
    return false;
}
</script>
Posted by: Guest on March-05-2020
0

how to make a button execute a javascript function

<button onclick"function name">Click</button>
Posted by: Guest on March-27-2021

Code answers related to "html button to call javascript function"

Code answers related to "Javascript"

Browse Popular Code Answers by Language