From c75701a0152a589c21c4862c33b691902a8b8f7b Mon Sep 17 00:00:00 2001 From: John Resig Date: Wed, 17 May 2006 18:46:51 +0000 Subject: [PATCH] Fixed bug with $.attr(), it was attempting to set attribute even if you're attempting to access a value. This was due to the !== null fix. --- jquery/jquery.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery/jquery.js b/jquery/jquery.js index 179cd29a..4592c1bf 100644 --- a/jquery/jquery.js +++ b/jquery/jquery.js @@ -573,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);