Monday, February 26, 2018

Fetching javascript from an External file

<!DOCTYPE html>
<html>
<body>

<h1>External JavaScript</h1>

<p id="demo">A Paragraph.</p>
<p id="memo">Yash Singh.</p>

<button type="button" onclick="myFunction()">Try it</button>

<p>(myFunction is stored in an external file called "myScript.js")</p>
<button type="button" onclick="f1()">Do this</button>
<p>(f1() is stored in an external file called "myScript1.js")</p>


<script src="myScript.js"></script>
<script src="myScript1.js"></script>

</body>
</html>
Thanks
Happy programming!

No comments:

Post a Comment

Sacred Thought

26 April 2024  Dear friends, I write the explanation of two verses of Geets for all of you, I hope you all will like it and benefit from it....