I. JavaScript INTRODUCTION
JavaScript is also known as JS, mainly responsible for the browser animation and other effects. Now the General browser is compatible with JS (IE6.7.8 may not be compatible with some usage).
Two. JS Common statements
1.document.write ();
Can be used directly with the HTML output stream, that is, the ability to directly in the Web page content output.
Instance:
2.alery ();
Web page bullets//No click on the page to do the next step
Instance:
3.confirm ();
message dialog box, Web page frame information user Click after the judgment, often used in the user to choose.
Instance:
4.prompt ();
A message dialog box, often used to communicate information to a user.
Instance:
5.window.open (opens a new window) with Window.close (Close window)
Grammar:
Open window: window.open ([url],[window name],[window parameter]);
Close window: Window.close ();//close this window
< Window object >.close ();//close specified window
6. Get the tag ID
Syntax: document.getElementById ("id");
Instance:
7.innerHTML
Used to get or replace HTML element content.
Syntax: object.innerhtml
Instance:
8. Use JS to modify the style of HTML elements
Syntax: Object.style.property=new style;
Instance:
9.display//Show or hide
Grammar:
Object.style.display = value
Value:
onoe;//Hidden
block;//Display
Instance:
10. Control class Name (classname property)
Gets the class property of the element, specifying a CSS style for an element of the page to change the appearance of the element.
Grammar:
Object.classname = ClassName
Instance:
JavaScript Learning Note 1