What is Dom
Dom: Full English name - Document Object Model Translated into Chinese is: Document object model. It sounds like a very term, but it is actually the structural relationship of the document content. Document type can be HTML or XML
Dom has access control capabilities for HTML files and XML file elements. To put it simply, using Dom can add, modify, and delete elements to a certain html or xml file. Change its existing structure or content.
If you have not been exposed to Dom, you will find Dom is amazing. . . Whether you are a novices or masters, Dom is crucial in this era of web design 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 things in JavaScript. In fact, these are all very important methods in Dom! I guarantee that the dom manual provided by the web circle will be the most extensive and detailed in this century. Read carefully the young programmer, I believe he will be helpful to you!
What can Dom do in a webpage?
The most commonly used methods in HTML Dom: Finding elements
- Dom's reference to the current entire web page document: document
- How to quickly find an element in a webpage: getElementById
- Find a set of tags in Dom, tag elements with the same name: getElementsByTagName
- Find multiple elements based on the Id attribute value or name attribute of the tag: getElementsByName
- Create a tag element in the web page: createElement
- Create a text content: createTextNode
- Add elements to the web page: appendChild
- The Dom method to delete elements is: removeChild
- Modify the attributes of tag elements in the web page: setAttribute
- ReplaceChild
- Copy the existing tag or element of clone: cloneNode
- Get and modify the html tags and text content within the element: innerHTML
- Get or modify the text content of an element, only supports IE: innerText
- Get or modify the text content of the element, support FF: textContent
- The insertRow method in HTML Dom can add a row to a table
- The method to delete a row in the table is: deleteRow
- The insertCell method in HTML Dom can add a column to a row in a table
- The method to delete a column in a row is: deleteCell
- The createCaption method in HTML Dom can create a title for a table
- The createTHead method in HTML Dom can create a Thead for a table
- The createTFoot method in HTML Dom can create a TFoot for a table
- The attributes that reference all rows in the table are: rows
- Refer to all columns of a row in a table: cells
- Move rows in tables, only IE: moveRow
- The instruction to get the parent element is: parentNode
- Get the first child element in the element: firstChild
- Get the last child element in the element: lastChild
- Get all child elements in the element: childNodes
- Get the previous sibling element: previousSibling
- Get the latter brother element
Dom manual instructions
You see the list on the left, that isDom Manual, you can click them to learn about their detailed description and usage. Use the index box to quickly find what you want in the Dom manual list. All Dom methods or attributes are in English, so Chinese search is not supported. For example, you can try to enter offsetTop or offsetLeft automatic completion function to make you more effective. The manual displays 50 contents per page, and you can use pagination navigation to check it. If you do not find what you want in the Dom manual, please check 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 manual.This is inseparable from your support and participation! Experts must be with everyone, and sharing is our eternal theme, so don’t be stingy with your code. Only by sharing can we step together and improve together. If you do not find the content you want in the content of the Css manual, please participate in our improvement plan, or if you do not explain the content of the Dom manual, you can also participate in the supplement. We are very happy to accept your suggestions! Participate in the manual improvement plan
Features of the Dom Manual
webProvided by CircleDom Online ManualFeatures are: eachDom's method or propertySyntax description and example demonstration of each Dom's method or attribute, each method or attribute compatible browser, and whether it is attached to W3C standards. And let every netizen participate in it and strive to brainstorm.