diff options
author | jeresig <jeresig@gmail.com> | 2009-12-18 12:41:53 -0500 |
---|---|---|
committer | jeresig <jeresig@gmail.com> | 2009-12-18 12:41:53 -0500 |
commit | d40083c866738727aa7ffd7f13d2955bc9575d5e (patch) | |
tree | be83f2130432bc8f8e500813ef6f33f62f836823 /src/attributes.js | |
parent | 148fb7ba8e992dd70c64cdc6a1c6f643fd1ba160 (diff) | |
download | jquery-d40083c866738727aa7ffd7f13d2955bc9575d5e.tar.gz jquery-d40083c866738727aa7ffd7f13d2955bc9575d5e.zip |
Disabled the passthrough .attr(method_name) functionality. You can now use it if you do: .attr({method_name: value}, true) OR as an easy initialization method: jQuery('<div/>', {html: '...', id: 'test'}).
Diffstat (limited to 'src/attributes.js')
-rw-r--r-- | src/attributes.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/attributes.js b/src/attributes.js index 90f3062ed..e7e5d378d 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -232,13 +232,13 @@ jQuery.extend({ offset: true }, - attr: function( elem, name, value ) { + attr: function( elem, name, value, pass ) { // don't set attributes on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { return undefined; } - if ( name in jQuery.attrFn && value !== undefined ) { + if ( pass && name in jQuery.attrFn ) { return jQuery(elem)[name](value); } |