I have this HTML code:
<!DOCTYPE html>
<html>
<body>
<p>Click the button to display an alert box:</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
alert("I am an alert box!");
}
</script>
</body>
</html>
Then I save this code as: C:/js.html
Then I write in the address-bar of my browser:
file:///C:/js.html#javascript:myFunction();
But the Javascript function is not executed. Why?
How can I make this work?