+ 1

JavaScript

What are External Files

6th Sep 2020, 7:23 PM
Zakir Hussain
Zakir Hussain - avatar
3 Answers
+ 2
External JavaScript files are files that you'd reference from an HTML file or a web page. You can put JavaScript in the HTML of a page using a script element or you can set the script element's src attribute to specify a URL for the JavaScript. In other words, you can use internal or external JavaScript. This offers more detail: https://www.w3schools.com/tags/att_script_src.asp
6th Sep 2020, 7:25 PM
Josh Greig
Josh Greig - avatar
6th Sep 2020, 7:25 PM
Nilesh
Nilesh - avatar
0
Inline js You put js things as attribute in html elements Ex- onclick="myFunction()" Internal js You you use script tag in html page Ex- <script> //Js code </script> External js When you link a js file to html file Ex- you have js file as myscript.js with js code for html element in index.html And you link it in html <script src="myscript.js" ></Script>
7th Sep 2020, 2:33 AM
Divya Mohan
Divya Mohan - avatar