Summary of DOM operations and compatibility issues inside JavaScript

Source: Internet
Author: User

DOM     Add, delete, change, check Oul.children          get UL sub-nodes           property with length oul.children[0]    get UL 1th child node     use more oul.children[ oul.children.length-1]    Get UL's last sub-node     Use more  oUl.parentNode    get UL parent node   & nbsp body,html,document oul.firstelementchild| | oul.firstchild    First node     "FirstChild low version ie6-8firstelementchild advanced Browser" oul.lastelementchild| | oul.lastchild    Last word node     Ditto  oli.previouselementsibling| | oli.previoussibling    Get previous sibling node     relative Oli.nextelementsibling| | oli.nextsibling    Get next sibling node     relative to yourself  var oli=document.createelement (' li ');    Create an Li node     Create an Assignment add 3 steps oli.innerhtml= '     assign it    oul.appendchild (oLi);    INSERT into Oul (insert backwards) common    oul.insertbefore (where to plug in)     INSERT into front of an element   &nbsP;oul.removechild (the element to remove);    Delete an element    node. CloneNode ()     Cloning an element     CloneNode (true) deep clone Remove ID: node. removeattribute (' id '); "  window.onscroll    Scrolling Events     window.onresize    window events when the mouse is scrolling     when the window shrinks/ Zoom in   Scroll distance     Match scrolling event var scrolltop=document.documentelement.scrolltop| | document.body.scrolltop document.documentelement.clientheight    Visible area height     document.documentelement.clientwidth    Viewport width    offsetheight (placeholder) (live event)     Object box Model height     border+padding+heightoffsetwidth (placeholder) (live event)    Object box model width     border+padding +width offsetparent    Locate parent     If no parent is located bodyparentnode     Structure parent  offsettop ( Placeholder objects)     Object box model the top value of the parent is located at the outermost distance     If no parent is located, it is relative bodyoffsetleft (placeholder object)     Object box model outermost distance position parent's left value     relative Body getattribute (' property ')     Get inline custom property if no parent is located   setattribute (' attribute ', ' property value ');    Set inline property values     corresponding use of removeattribute (' properties ')     remove attributes nbsp  

Summary of DOM operations and compatibility issues inside JavaScript

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.