In order for the browser to run JavaScript, you must first have an HTML page, introduce JavaScript into the HTML page, and then let the browser load the HTML page to execute the JavaScript code.
1. Internal references
JavaScript code can be directly embedded in the Web page of any place. No, but now we usually put the JavaScript code before the "(end tag)." The code included is the JavaScript code, which will be directly controlled by the browser. Line
2. External references
The second way is to put the JavaScript code into a separate JS file, and then in the HTML through <script src= "..." ></script> introduce this file
There are three ways to output:
1. Page Output
document.write ("Hello wolrd");
2 Console output
Console.log ("Hello wolrd");
Console.info ("Hello wolrd");
3. Pop-up window output
Alert ("Hello wolrd"); Prompt ("Hello wolrd");
JS Basic knowledge