The terms attribute and property can be confusing in HTML.
For example the javascript framework Angular has the concepts Property Binding and Attribute Binding . Without knowing the difference between the two it is difficult to grasp the difference between those concepts.
The major difference between the two is this:
Attribute is related to HTML
Property is related to DOM
Other differences:
- Attribute and Property names are not always similar
- Changing Attribute/Property values doesn't always get reflected to the other
- Attribute is case sensitive , Property is not
- Attribute values are always strings , Property can be of different data types
Here is an explanation with examples:
Attribute vs Property
Top comments (0)