http://api.jquery.com/prop/
http://stackoverflow.com/questions/5874652/prop-vs-attr/5884994#5884994
http://stackoverflow.com/questions/5874652/prop-vs-attr/5884994#5884994
A DOM element is an object, a thing in memory. Like most objects in OOP, it has properties. It also, separately, has a map of the attributes defined on the element (usually coming from the markup that the browser read to create the element). Some of the element's properties get their initial values fromattributes with the same or similar names (valuegets its initial value from the "value" attribute;hrefgets its initial value from the "href" attribute, but it's not exactly the same value;classNamefrom the "class" attribute). Other properties get their initial values in other ways: For instance, theparentNodeproperty gets its value based on what its parent element is; an element always has astyleproperty, whether it has a "style" attribute or not.
No comments:
Post a Comment