I have a simple javascript onclick function call that isn't working, and I just keep staring and I cant see anything wrong, I feel like I must be overlooking something super simple but I just cant see what!
https://jsfiddle.net/sanfly/tob4dugj/
HTML:
<p id="demo"></p>
<button onclick="myFunction()">Click me</button>
JS:
function myFunction() {
document.getElementById("demo").innerHTML = "Hello World";
}
Error:
Uncaught ReferenceError: myFunction is not defined at HTMLButtonElement.onclick