Home  >  Forum  >  HTML, CSS
Post New Query

HTML attribute vs DOM property


joined on
February 09,2016
Asked on November 14,2016

What is difference between HTML attribute vs. DOM property?

joined on
November 18,2013
Replied on November 14,2016

Find some differences between  HTML attribute and DOM property


1. Attributes are defined by HTML and properties are defined by DOM.


2. The responsibility of HTML attributes is just to initialize DOM properties.  And then later DOM properties can change but HTML attributes cannot. 


3. There are some HTML attributes that have corresponding DOM property  and those DOM properties have corresponding HTML attributes such as id.


4.  There are also some HTML attributes that do not have corresponding DOM property such as colspan.


5. There are also some DOM properties that do not have corresponding HTML attributes such as textContent.


6.  The HTML attribute value contains initial value where as DOM property value contains current value.


Write Answer




Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us