JavaScript can appear anywhere in HTML. Use tag & lt; script & gt ;... & Lt; script & gt;, you can insert JavaScript anywhere in the HTML document, or even before & lt; HTML & gt.
Where to insert JavaScript
JavaScript can appear anywhere in HTML. Mark script... Script, you can insert JavaScript anywhere in the HTML documentPreviously inserted is not a problem. However, if you want to insert a file in the webpage of the declared framework (the webpage of the Framework), you mustInsert before, otherwise it will not run.
Basic Format
The Code is as follows:
Script
Script
The role of the second and fourth rows is to make browsers that do not understand the script mark ignore JavaScript code. Generally, it can be omitted because I want to find a browser that doesn't understand the Script, and I'm afraid I don't even have it in the museum. The double Backslash "//" at the front of the fourth line is the annotation label in JavaScript and will be learned later.
Another way to insert JavaScript is to write JavaScript code to another file (this file should usually use ". js" as the extension), and then use the format"