사용자 도구

사이트 도구


wiki:miscellaneous:attribute-property

Document

  • description : 어트리뷰트와 프라퍼티 (attribute and property)의 차이
  • author : 오션
  • email : shlim@repia.com
  • lastupdate : 2021-02-26


Source of the article

어트리뷰트와 프라퍼티 (attribute and property)의 차이


어트리뷰트 (Attribute)

  • HTML 요소에 대한 추가정보를 가지고 있으며, name=“value”와 같이 한 쌍으로 표시됩니다.
  •  (ex) <div class="my-class"></div> 
    • div → tag이며 element(요소)
    • class → attribute
    • my-class → class attribute의 값


프라퍼티 (Property)

  • 프라퍼티 (Property)는 HTML DOM tree에 있는 속성(attribute)에 대한 표현이다.
  •  <div class='my-class'></div>를 DOM으로 표현하면 아래와 같다.
  •  
        Our DIV node
         |- nodeName = "DIV"
         |- className = "my-class"    // className이 property가 된다
         |- style
           |- ...
         |- ...
        
  • html 문서에서는 class가 attribute를 의미한다.
  • html DOM에서 class는 property를 의미한다.

계속 작성해야 한다.

/var/services/web/dokuwiki/data/pages/wiki/miscellaneous/attribute-property.txt · 마지막으로 수정됨: 2023/01/13 18:44 (바깥 편집)