Web Learning Syllabus (1116/1130 for preview or review)

Source: Internet
Author: User
Tags tag name

The first part of the basic syntax:

1. Data type (string, Decimal, Integer, Boolean, Time date)
var s= "3.14" var n=parsefloat (s) s+=5;
var s= "abc3.14" var n=parsefloat (s)//nan s+=5;//parse convert to decimal type
var d=parseint (s)//parse converted to integer type
IsNaN (String), judging is not the number of the shape of the string, is-false; no-true
2. Variables
3, operators: four categories
4. Expressions (in order to make statements): Variable + operator
5, statement: three major categories ()
Classification:
Order
Branch: If;if. Else,if. else.. If.. Else...if. Else;if nesting
Switch...case
Circulation: Exhaustive method, iterative method, four elements (initial condition; cyclic condition; cyclic body; state change)
For ...
While ...
6, array: var a= new Array ();
7, Function: Four elements (name, input, return, processing)
Function Show ()
{

}
The second part DOM operation (manipulating HTML) tree
Windows objects--browser window
[Window.document.
Window.alert ()]
window.location--Address Bar
window.history--forward and backward (visit history)
window.status--status bar
Window.document; (emphasis)
Part III Document object:
1. Find
var D=document.getelementbyid ("ID of Element")
var d=document.getelementsbyname ("Name of Element")
var d=document.getelementsbytagnme ("tag name of element")
2. Operation element Content
Common elements: hyperlinks, pictures
Divided into 2 categories:
(1) Form element (3 Class) text (Imput:type=text,password,textarea,hidden), button (Submit/reset/button/image), selection (radio/checkbox/ Select drop-down list, list box/file)
Assignment value d.value=xxxx;
Value Var S=d.value
(2) Non-form elements: H1....h6;p;div;span;ul;ol;li (Memory News)
Control format Labels
Content container Tags:
Assignment value: d.innerhtml=xxxx;
Value: Var s=d.innerhtml;
3. Manipulating element properties
D.setattribute (name, value)
var s=d.getattribute (name)
D.removeattribute (name)
4. Operation element Style
(1) Inline style:
D.style xxxxx=xxxx;
var S=d.style.backgroudcolor;
(2) Class attribute
D.classname= ""
5. Operation related elements
Up, down, inside and outside

Web Learning Syllabus (1116/1130 for preview or review)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.