In order to understand it, we need to have a clear in-depth knowledge between Document Object Model(DOM) and HyperText Markup Language(HTML).
Basically, DOM is a model of objects and is a logical tree representation of the document whereas HTML is a markup language that we used to build web-pages.
Every HTML attributes have one to one mapping to properties of DOM objects.
Example: First Name
So, The above example contains two tags label and input. As we can observe, there is an attribute defined inside the input tag which is “disabled”.
Similarly, if you talk about DOM properties, disabled is also present inside the input object.
But they are cases where some attributes of HTML tags are not available inside the DOM.
Example: colspan. Like colspan, So when you try to use them for attribute binding in Angular 2+, you will get an error which says “can’t bind to colspan since it isn’t a known property of ‘td’ “.
Similarly, we have some properties which are defined in DOM but are not present in HTML.
In order to use them for attribute binding you need to use the following syntax “[attr.colspan]”.
- HTML | <th> colspan Attribute
- HTML | colspan Attribute
- HTML | <td>colspan Attribute
- Adding Angular Material Component to Angular Application
- HTML | DOM TableData colSpan Property
- Angular 7 | Angular Data Services using Observable
- Routing in Angular JS using Angular UI Router
- Angular CLI | Angular Project Setup
- Difference between Angular 4 and Angular 5
- How to use Typescript with native ES6 Promises ?
- How React Native works?
- Why You Should Choose React Native?
- React Native | Expo - BarCodeScanner
- How to Create Button in React-Native App ?
- Native MongoDB driver for Node
- Difference between React Native and Flutter
- Android & iOS App development using React Native with Expo
- Angular 7 | Installation
- How to use jQuery in Angular ?
- Angular 7 | Architecture