R
RobG
It seems the jQuery developers finally listened to criticism of the
attr() method so that in version 1.6 it returns the value of HTML
attributes, not DOM properties. New prop() and removeProp() methods
have been introduced for properties.
This seems to address one of the more important criticisms of jQuery -
that it confuses attributes and properties. Does this move jQuery
toward becoming a recommendable library, or do the cons still out
weigh the pros?
It seems to me that they still have a little way to go - they need a
removeAttr() method to match removeProp(), and the other two methods
should be getAttr() and getProp(). If they'd done that, they could
have deprecated attr() for this release so that it kept backward
compatability and flagged it for removal in 1.7 or whatever comes
next.
attr() method so that in version 1.6 it returns the value of HTML
attributes, not DOM properties. New prop() and removeProp() methods
have been introduced for properties.
This seems to address one of the more important criticisms of jQuery -
that it confuses attributes and properties. Does this move jQuery
toward becoming a recommendable library, or do the cons still out
weigh the pros?
It seems to me that they still have a little way to go - they need a
removeAttr() method to match removeProp(), and the other two methods
should be getAttr() and getProp(). If they'd done that, they could
have deprecated attr() for this release so that it kept backward
compatability and flagged it for removal in 1.7 or whatever comes
next.