Commit c75701a0 authored by John Resig's avatar John Resig

Fixed bug with $.attr(), it was attempting to set attribute even if you're...

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.
parent 3386923d
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment