1<!--
2 Your script is most likely after your HTML.
3 Include it before html, so that your function is defined.
4
5 Another reason your function may be undefined is beacuse there is
6 some kind of error blocking your function from exectuing!
7-->
8
9<script>
10 function BtnPress() {
11 console.log("I work because i am defined before my caller!");
12 }
13</script>
14
15<button onclick="BtnPress()">Press Me!</button>