jquery attributes: closes #5234. attr() supports jQuery.fn methods.

This commit is contained in:
Ariel Flesler 2009-09-15 17:23:26 +00:00
parent 8356871a55
commit 5550356a12
2 changed files with 50 additions and 2 deletions

View file

@ -185,6 +185,10 @@ jQuery.extend({
if (!elem || elem.nodeType == 3 || elem.nodeType == 8)
return undefined;
if ( name in jQuery.fn && name !== "attr" ) {
return jQuery(elem)[name](value);
}
var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
// Whether we are setting (or getting)
set = value !== undefined;