aboutsummaryrefslogtreecommitdiffstats
path: root/src/attributes.js
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2009-12-18 12:41:53 -0500
committerjeresig <jeresig@gmail.com>2009-12-18 12:41:53 -0500
commitd40083c866738727aa7ffd7f13d2955bc9575d5e (patch)
treebe83f2130432bc8f8e500813ef6f33f62f836823 /src/attributes.js
parent148fb7ba8e992dd70c64cdc6a1c6f643fd1ba160 (diff)
downloadjquery-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.js4
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);
}