Use .prop instead of .attr where appropriate
[lhc/web/wiklou.git] / resources / jquery / jquery.byteLimit.js
index 3f18ab1..64ccb5c 100644 (file)
@@ -31,7 +31,7 @@
 
                // Default limit to current attribute value
                if ( limit === undefined ) {
-                       limit = this.attr( 'maxLength' );
+                       limit = this.prop( 'maxLength' );
                }
 
                // Update/set attribute value, but only if there is no callback set.
                // Usually this isn't a problem since browsers ignore maxLength when setting
                // the value property through JavaScript, but Safari 4 violates that rule, so
                // we have to remove or not set the property if we have a callback.
-               if ( fn === undefined ) {
-                       this.attr( 'maxLength', limit );
+               if ( fn == undefined ) {
+                       this.prop( 'maxLength', limit );
                } else {
-                       this.removeAttr( 'maxLength' );
+                       this.removeProp( 'maxLength' );
                }
 
                // Nothing passed and/or empty attribute, return without binding an event.