Answers for "html onclick can't find function"

0

html onclick can't find function

<!--
	Your script is most likely after your HTML.
	Include it before html, so that your function is defined.

	Another reason your function may be undefined is beacuse there is 
	some kind of error blocking your function from exectuing!
-->

<script>
	function BtnPress() {
		console.log("I work because i am defined before my caller!");
    }
</script>

<button onclick="BtnPress()">Press Me!</button>
Posted by: Guest on October-05-2020

Browse Popular Code Answers by Language