Parentnode,parentelement,offsetparent

Source: Internet
Author: User
Offsetparent directly will be the upper element that affects the position of the elements, while the parentelement is independent of the position display when the upper element in the DOM. For example:  <BODY>  <div style= "border:1px solid black;position:absolute;" >   <form>   <input type= "checkbox" Id= "CC" >   </form>   </div> This example, "CC" The offsetparent of the element is a div, and if the position attribute of the DIV is removed, then CC's offsetparent becomes body. And parentelement has always been a form. There are also two properties related to Offsetleft and offsettop, each representing the left and top distances of the element corresponding to the offsetelement. Like the parentnode and parentelement functions, childnodes and children function the same. But ParentNode and ChildNodes are in line with the standard, can be said to be more general. And the other two is only IE support, not the standard, Firefox does not support.



Parentnode,parentelement,offsetparent

Related Keywords:

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.