In jQuery1.6, a new prop method is added. It seems to be the same as the attr method. What is the difference between the two methods? From the difference between attribute and property in HTMl, attr and prop are the abbreviations of these two things.
Attribute and property
Attribute and property can both be translated into attributes. To show differences, these two words are usually translated into attributes and features.
Click Here
The preceding HTML statement contains three nodes: Element "p", attribute "id", and Text "click here". The most common attribute is the attribute type node, there are special attribute processing functions in JavaScript. getAttribute (name)/setAttribute (name, value ). Of course, attribute is not just what we can see in the HTML document. We can add custom attributed to the DOM node.
The Code is as follows:
123