Fixed bug with $.attr(), it was attempting to set attribute even if you're attempting...
[jquery.git] / jquery / jquery.js
index 2e29fa5..4592c1b 100644 (file)
@@ -9,6 +9,9 @@
  * $Rev$
  */
 
+/* For JSLint (jslint.com): */
+/*extern ActiveXObject Prototype setTimeout setInterval clearInterval document window XMLHttpRequest navigator*/
+
 function $(a,c) {
        var $a = a || $.context || document;
        var $c = c && c.$jquery && c.get(0) || c;
@@ -570,7 +573,7 @@ $.attr = function(o,a,v){
                a = (fix[a] && fix[a].replace && fix[a]) || a;
                var r = new RegExp("-([a-z])","ig");
                a = a.replace(r,function(z,b){return b.toUpperCase();});
-               if ( v !== null ) {
+               if ( typeof v != 'undefined' ) {
                        o[a] = v;
                        if ( o.setAttribute ) {
                                o.setAttribute(a,v);