While, generally speaking, HTML is forContent and CSS is forPresentation, JavaScript is forInteractivity.
1. From HTML to JavaScript, like this:
<! DOCTYPE html> <script> alert ("Hello, World"); </script> </body>
Alert means a warning, similar to a message. The effect is to pop up a dialog box.
2. Referring to the external. js File
<!DOCTYPE HTML><HTML> <Head> <MetaCharSet= "UTF-8"> <title></title> </Head> <Body><script src= "script.js" ></script> </Body></HTML>
Script.js
Alert ("Hello, World");
3, running JavaScript code in the browser console, chrome access to the console shortcut key is F12
4, before the formal start of study, need to emphasize is:
A Browser then runs JavaScriptLine-by-line, starting at the top of the file orscriptElement and finishing at the bottom (unless-it to go elsewhere).
5, ask the user last name of the small program
<! DOCTYPE html> var surname = prompt (' Greetings friend, May I enquire as to your surname? '); </script> </body>
Running this code through the browser will jump out of a "small box" and ask for your last name.
6, the variable is similar to a "box", we use it to store data; it has "name" and "value".
Statement (Declaration)
var surname; var age;
Initialize (initialization)
var name = "Tom";
Assign Value (Assignment)
Name = "Andy"= 43;
"JavaScript" note 01--making Stuff happen???