What is Dom? _ DOM

Source: Internet
Author: User
The full name of Dom-DocumentObjectModel is translated into Chinese: the object model of a document. It sounds like a term, in fact, the structure of the document content. The document type can be HTML or XML. Reminder: Dom Document Object Model chm provides download and click to download

What is Dom?

Dom
Dom has the ability to access Html files and XML file elements. In short, Dom can be used to add, modify, and delete elements to an html or xml file. It can be used to change its existing structure or content.
If you have never touched Dom, you will find Dom amazing... whether you are a cainiao or a master, Dom is crucial in this web design age that focuses on user experience. if you are an experienced web designer, you should have seen or used the following commands or methods: getElementById getElementsByTagName offsetParent appendChild getAttribute. However, some people still think that these are all in JavaScript, otherwise, these are all very important methods in Dom! I promise that the dom manual provided by web circles will be the most comprehensive and detailed content of dom in this century. Read it carefully and believe that it will help you!


What can Dom do on a webpage?

Search elements of the most common methods in HTML Dom

  1. Reference of Dom the entire webpage document: document
  2. How can Dom quickly search for an element in a webpage: getElementById?
  3. Search for a group of tags in the Dom. The element with the same name is getElementsByTagName.
  4. Find multiple elements based on the tag's Id attribute value or name attribute: getElementsByName
In the Dom, you can create, add, delete, modify, replace, and copy labels and text content on the webpage as follows.
  1. Create a Tag Element in the webpage: createElement
  2. Create a text section: createTextNode
  3. Add an element to the webpage: appendChild
  4. The method to delete the Dom of an element is removeChild.
  5. SetAttribute
  6. ReplaceChild
  7. Copy and clone an existing tag or element: cloneNode
  8. Get and modify the html Tag and text content in the element: innerHTML
  9. Obtains or modifies the text content of an element. Only IE: innerText is supported.
  10. Obtains or modifies the text content of an element. FF: textContent is supported.
HTML Dom also provides a set of APIs to operate Table elements in a webpage.
  1. The insertRow method in the HTML Dom can add a row to the table.
  2. To delete a row in a table, use deleteRow.
  3. The insertCell method in the HTML Dom can add a column to a row in the table.
  4. The method for deleting a column in a row is: deleteCell
  5. The createCaption method in the HTML Dom can create a title for the table.
  6. The createTHead method in the HTML Dom can create a Thead for the table.
  7. The createTFoot method in the HTML Dom can create a TFoot for the table.
  8. The attribute of referencing all rows in the table is rows.
  9. Reference all columns of a row in the table: cells
  10. Move rows in a table. Only Internet Explorer: moveRow is supported.
Related commands for operating parent, child, and sibling elements in Dom
  1. The command to obtain the parent element is: parentNode
  2. Obtain the first child element in the element: firstChild
  3. Obtain the last child element in the element: lastChild
  4. Obtain all child elements in the element: childNodes
  5. Get the previous sibling element: previussibling
  6. Get the last sibling Element
Author: Kang Dong 2010-10-22

Dom manual instructions

The list on the left isDom ManualYou can click them to learn more about the instructions and usage. you can use the index box to quickly search for the content you want in the Dom manual list. all Dom methods or attributes are English letters, so Chinese search is not supported. for example, you can try to enter the offsetTop or offsetLeft auto-completion function to get twice the result with half the effort. this manual displays 50 entries per page. You can use the paging navigation to view the content. if you do not find the content you want in this Dom manual, please refer to the Dom manual improvement plan below!


Dom manual Improvement Plan

WebCircle is committed to creating the most comprehensive and detailedHtml manual, css manual, dom manual, javascript manual, xmlhttp ManualYour support and participation are indispensable! The master will be happy with everyone, and fenheng is our eternal theme, so do not mean your code. only by sharing can we step together and improve together. if you have not found the content in the Css manual, find the content you want. please participate in our improvement plan, or you may participate in the supplement if the content of this Dom manual is not explained properly. we are very happy to receive your suggestions! Participate in manual Improvement Plan


Features of this Dom Manual

WebProvidedDom online manualFeatures:Dom methods or attributesThe example shows how to deeply understand the methods or attributes of each Dom, the browsers that are compatible with each method or attribute, and whether the W3C standard is included. in addition, every netizen is allowed to participate in the process and strive to brainstorm.

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.