====== Document ====== * description : 어트리뷰트와 프라퍼티 (attribute and property)의 차이 * author : 오션 * email : shlim@repia.com * lastupdate : 2021-02-26 \\ ====Source of the article==== * [[http://jquery-howto.blogspot.com/2011/06/html-difference-between-attribute-and.html|HTML: The difference between attribute and property]] * [[https://medium.com/hexlant/attribute-%EC%99%80-property-%EC%9D%98-%EC%B0%A8%EC%9D%B4-c6f1c91ba91|attribute 와 property 의 차이]] =====어트리뷰트와 프라퍼티 (attribute and property)의 차이===== \\ ====어트리뷰트 (Attribute) ==== * HTML 요소에 대한 추가정보를 가지고 있으며, ''name="value"''와 같이 **한 쌍**으로 표시됩니다. * (ex)
* div -> tag이며 element(요소) * class -> attribute * my-class -> class attribute의 값 \\ ====프라퍼티 (Property) ==== * 프라퍼티 (Property)는 HTML DOM tree에 있는 속성(attribute)에 대한 표현이다. *
를 DOM으로 표현하면 아래와 같다.
* Our DIV node |- nodeName = "DIV" |- className = "my-class" // className이 property가 된다 |- style |- ... |- ... * html 문서에서는 class가 attribute를 의미한다. * html DOM에서 class는 property를 의미한다. 계속 작성해야 한다. {{tag>오션 어트리뷰트, 프라퍼티, attribute, property}}