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'}).
This commit is contained in:
parent
148fb7ba8e
commit
d40083c866
4 changed files with 35 additions and 13 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue