Home > Web Front-end > HTML Tutorial > After having a certain understanding of HTML, I now started to learn HTML DOM. _html/css_WEB-ITnose

After having a certain understanding of HTML, I now started to learn HTML DOM. _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:56:50
Original
843 people have browsed it

I can finally write down my thoughts

I spent five weeks learning XML, HTML, XHTML, CSS, and javascript languages ​​and have a certain understanding of them. Today I started learning HTML DOM. I mostly started from the website http://www.w3school.com.cn/, which is very good. I have read some knowledge about HTML DOM in the past few days, and now I will share my superficial understanding of it. Of course, my understanding is very shallow. My direct purpose is not to muddle along, just understand it in my heart, but to put my understanding of it into perspective. I understand and write it down. I hope the masters of the blog park can stay for a minute and leave more suggestions for me

Document Object Model (Document Object Model), referred to as DOM.

  • DOM is a W3C (World Wide Web Consortium) standard and a rule.
  • DOM defines standard rules for accessing and manipulating HTML and XML content. Just like the VIP cards we use for haircuts, barber shops stipulate that only members can enjoy discounts. This is a standard. The rules of barber shops are similar to DOM. The content of discounts is like HTML or XML content. Only members can enjoy the discounts. Only with this provision can the content be accessed correctly.
  • In HTML DOM, all elements are regarded as nodes, and the entire HTML document is regarded as a node tree. In the future, the elements defined in DOM will be used Standard methods are used to access these nodes. This is actually the role of DOM, which converts the content of the HTML document into node form for easy access and use.
  • The following is an example of HTML DOM node tree


    With the concept of this node tree, we can use The DOM standard uses JavaScript language to access all node contents in the node tree.

    All HTMl element content is regarded as an object, and the properties and methods of the object are programming interfaces

  • getElementById() method
  • The getElementById() method returns the element with the specified ID: Example http://www.w3school.com.cn/tiy/t.asp?f=dom_getelementbyid

  • innerHTML attribute
  • innerHTML attribute is used to get or replace the content of the HTML document: example http://www.w3school.com.cn/tiy/t.asp?f=dom_innerhtml

    For more object methods and properties, please visit http://www.w3school.com.cn/htmldom/dom_methods.asp

    Related labels:
    source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template