Javascript learning journey (3)

Source: Internet
Author: User

Childnodes attribute: returns an array containing all the child elements of the given element node.
Childtype attribute: The returned array contains all types of nodes.
Nodevalue attribute: changes the value of a text node.
Firstchild and lastchild attributes: whenever and wherever you need to access the first element of the childnodes [] array, you can write it as firstchild.
Node. firstchild is equivalent to node. childnodes [0].
Likewise
Node. lastchild is equivalent to node. childnodes [node. childnodes. Length-1]

Chapter 5 JavaScript programming principles and good habits

Reserved return route
Separating Javascript
Backward compatibility

Chapter 6

Bind multiple JavaScript Functions to the onload event handler

Function addloadevent (func ){
Varoldonload = Window. onload;
If (typeof window. onload! = 'Function '){
Windows. onload = func;
}
Else {
Window. onload = function (){
Oldonload ();
Func ();
}
}
}

Call Method
Addloadevent (method name );
Addloadevent (method name );

Related Article

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.