Javascript is the scripting language of the browser.
What can be done
1. Read elements from the document, and return the elements to the document and write the text into the document;
2. operate or move text;
3. mathematical calculation of data;
4. Respond to events;
5. Check the current date and time or the last modification time of the document on the user's computer;
6. determine the user's display size, browser version, or screen resolution;
7. Perform deduction based on some conditions. For example, an alarm is triggered when an error message is entered in the form.
Dom.Object Model, with rename, method, and event.
DOM objects use the "." sign to access attributes, sub-objects (or subscripts.
Document window object. Each browser window corresponds to a window object, which is an object created with each instance of the <body> or <frameset> element.Links is the link sub-object, and forms is the form Sub-object. Anchor is a connectable anchor. Applet is smallProgram.
Image ing objects in the range of area <area>.
Imag image object.
String object. For example, mystr = New String
Date object. The UTC time is used to add or subtract the number of milliseconds from the date.
Math data object.
Array object. Construct arr = new Aray ("phf", "host"); or arr = new array (10); // specify the number
Usage
1. Write JavaScript directly in the host language file. <SCRIPT type = "text/JavaScript"> ...... </SCRIPT>
2. Use a. js script file. <SCRIPT type = "JavaScript" src = "JS/login. js">... </SCRIPT>
3. When the host language is HTML. JavaScript scripts can be stored in<Body> part, which is run when the webpage is loaded. Or in<Head> partially declared, called when an event is triggered.
Variable. Declare with VAR (not mandatory), case sensitive.
Logical operators.?? Represents or
Function. Declared with function, can only be placed in the