X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fattributes.js;h=9c868ee0359dd1e155415cbc11b606da3bb75e2e;hb=ecdcda870c70c262ec3198e067dd06e847f682dd;hp=8080af83d2755430b8b7c3d1fc93839233bff1e0;hpb=1a4d1904ae8631f94b7400d99af24d3fe2f33ecd;p=jquery.git diff --git a/src/attributes.js b/src/attributes.js index 8080af8..9c868ee 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -200,12 +200,28 @@ jQuery.each({ }); jQuery.extend({ + attrFn: { + val: true, + addClass: true, + css: true, + html: true, + text: true, + append: true, + prepend: true, + data: true, + width: true, + height: true, + offset: true, + bind: true + }, + attr: function( elem, name, value ) { // don't set attributes on text and comment nodes if (!elem || elem.nodeType == 3 || elem.nodeType == 8) { return undefined; } - if ( name in jQuery.fn && name !== "attr" ) { + + if ( name in jQuery.attrFn ) { return jQuery(elem)[name](value); }