My scenario is as this:-
parent.html
<html>
<script type="text/javascript" src="myjs.js"></script>
<body>
<a href="./child.html"> child </a>
</body>
</html>
myjs.js
function myFunction() {
alert("I am an alert box!");
child.html
<html>
<body>
<button onclick="">child button</button>
</body>
</html>
I added JavaScript to the parent HTML and the parent has a link to the child HTML page. I want to call JavaScript function myFunction() from the child without adding the JavaScript in the child HTML. Is it possible to call the JavaScript function from the child without adding
<script type="text/javascript" src="myjs.js"></script>