JavaScript code must be executed through the html/xhtml document, and the first way is to put the JS code between the <script> tags in the document to put the < Script> tags are placed before the last,<body> tag of the HTML document , allowing the browser to load the page faster
PS: Browser page load order: Please read this article
JS Note: 1,///2,/* 3, JS can be used <!--to comment, but this comment in JS can only comment one line, in the HTML can be cross-line, so in order to avoid confusion, JS best not to use this style of comments, suggested with//to comment on a single line,/* to comment on multiple lines
JS allows programmers to directly assign values to variables without prior declaration, the most efficient declaration and assignment practices: var mood= "Happy", age=33;
JS is a weakly typed language, meaning that programmers can change the data type of a variable at any stage
The character is escaped with a backslash in JS
Read "JavaScript DOM Programming Art (2nd edition)" Note