]> source.dussan.org Git - jquery.git/commitdiff
Merge branch 'attrhooks.1.6v2' of https://github.com/timmywil/jquery into timmywil...
authorjeresig <jeresig@gmail.com>
Sun, 10 Apr 2011 19:41:51 +0000 (15:41 -0400)
committerjeresig <jeresig@gmail.com>
Sun, 10 Apr 2011 19:41:51 +0000 (15:41 -0400)
Conflicts:
src/attributes.js

1  2 
src/attributes.js

index e5425a051c079329b8c62f345bd680f0ef1f996c,b4330a86e220fbb23a09acf5ed5b3378a2012a55..f7c2e981871b86901c16bd998d95c67eacafd36d
@@@ -15,16 -16,14 +16,28 @@@ jQuery.fn.extend(
  
        removeAttr: function( name ) {
                return this.each(function() {
-                       if ( this.nodeType === 1 ) {
-                               this.removeAttribute( name );
-                       }
+                       jQuery.removeAttr( this, name );
+               });
+       },
+       
+       prop: function( name, value ) {
+               return jQuery.access( this, name, value, true, jQuery.prop );
+       },
+       
++      removeProp: function( name ) {
++              return this.each(function() {
++                      // try/catch handles cases where IE balks (such as removing a property on window)
++                      try {
++                              this[ name ] = undefined;
++                              delete this[ name ];
++                      } catch( e ) {}
 +              });
 +      },
 +      
 +      prop: function( name, value ) {
 +              return jQuery.access( this, name, value, true, jQuery.prop );
 +      },
 +      
        removeProp: function( name ) {
                return this.each(function() {
                        // try/catch handles cases where IE balks (such as removing a property on window)
@@@ -445,7 -511,7 +525,7 @@@ if ( !jQuery.support.optSelected ) 
                                }
                        }
                }
-       };
+       });
  }
  
 -})( jQuery );
 +})( jQuery );