Thanks for contributing an answer to Stack Overflow!External JavaScript file We can create external JavaScript file and embed it in many html page It provides code re usability because single JavaScript file can be used in several html pages An external JavaScript file must be saved by js extension It is recommended to embed all JavaScript files into a single fileThe HTML The HTML tag is used to define a clientside script (JavaScript) The element either contains script statements, or it points to an external script file through the src attribute Common uses for JavaScript are image manipulation, form validation, and dynamic changes of content Get Url And Url Parts In Javascript Css Tricks Script type= text/javascript src= path-to-javascript-file.js /script