TIL31 - DOM

Peter D Lee·2020년 9월 11일
0

DOM

목록 보기
1/1
post-thumbnail

What is DOM?
> Document Object Model - a structural model that organizes a webpage's HTML document as an object. Using JavaScript, we can access and make changes to the HTML document through the use of this document object.

DOM can be seen as a link between a webpage's HTML file and the scripting language(most commonly JavaScript). The DOM allows you to use JavaScript to access and make changes to the HTML document by accessing the HTML's elements. So basically, JavaScript uses DOM to access HTML.


DOM Structure

DOM has a tree structure and is composed of nodes.

  • A node is an intersecting point in the DOM tree
  • A node is an object and each node contains some data
  • Every object inside the document is a node of some kind
  • The root node, or the top-most node in the DOM, is the document object representing the HTML document itself
  • The rest of the document is composed of a series of parent-child nodes
  • In the HTML document, a node object can be an element node, a text node, or an attribute node
    (source codecademy.com)

0개의 댓글