JavaScript Learning Tour (3) _ Basic knowledge

Source: Internet
Author: User
ChildNodes property: Returns an array that contains all the child elements of a given element node.
Childtype property: The returned array contains all types of nodes
NodeValue property: Changing the value of a text node
FirstChild and LastChild properties: whenever and wherever you need access to the first element of the childnodes[] array, you can write it as a firstchild outside.
Node.firstchild equivalent to Node.childnodes[0]
Similarly
Node.lastchild equivalent to Node.childnodes[node.childnodes.length-1]

Fifth chapter JavaScript Programming principles and good habits

Set aside a retreat
Detach JavaScript
Backward compatibility

Sixth chapter

To 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.