from docs
The difference between attributes and properties can be important in specific situations. Before jQuery 1.6, the .attr () method sometimes took property values ββinto account when retrieving certain attributes, which can lead to inconsistent behavior. Starting with jQuery 1.6, the .prop () method provides a way to explicitly retrieve property values, while .attr () retrieves attributes.
Example
For example, selectedIndex, tagName, nodeName, nodeType, ownerDocument, defaultChecked and defaultSelected should be retrieved and set using the .prop () method. Prior to jQuery 1.6, these properties were restored using the .attr () method, but this was not within the scope of attr. They do not have corresponding attributes and are only properties.
updated after comment
You can set an attribute for an HTML element. You define it when writing the source code, as soon as the browser analyzes your code, a corresponding DOM node will be created, which is an object that thus has properties.
A simple example might be ...
<input type="test" value="test" id="test" />
Here type, value, id are attributes. When the browser displays it, you will get other properties such as align, alt, autofocus, baseURI, checked , etc.
link if you want to know more about it
bipen Apr 17 '13 at 4:30 2013-04-17 04:30
source share