Javascript Insert directly into HTML document This is a method to create a This method is useful if you use JavaScript for some pages or if your JavaScript code is short. Create and load a script file How to link to an HTML document after creating a file containing JavaScript code. Create a file with the following content and save it as hello.js. (The extension of the script file is js.) alert (..