The above description may be a little vague, as you can see in a few examples.
<href= "http://www.baidu.com" target= "_self" class= "BTN"> Baidu </a >
In this example, the DOM attribute of the <a> element has "href, target, and class", which is the property of the <a> element itself, and is a property that is included in the standard, or that can be intelligently prompted in the IDE. These are called intrinsic properties. The prop method is recommended when working with these properties.
<href= "#" id= "link1" action= "Delete"> Delete </a>
In this example, the DOM attribute of the <a> element has "href, id, and action", and it is clear that the first two are intrinsic properties, and the next "action" attribute is our own custom,<a> element itself without this attribute. This is a custom DOM property. The attr method is recommended when working with these properties. When you use the Prop method to take values and set property values, the undefined value is returned.
One more example:
<id= "chk1" type/> is visible
<id= "chk2" typechecked/> is visible
For elements like Checkbox,radio and select, the selected attribute corresponds to "checked" and "selected", which are also intrinsic properties, so you need to use the Prop method to operate to get the correct results.
Falsetrue
If the attr method is used above, it will appear:
$ ("#chk1"). attr ("checked") = = undefined$ ("#chk2"). attr ("checked") = = "Checked"
Complete the full text.