I'm using jQuery 1.6.1 and the attr() method, It's working fine on all browsers except IE7.
In the console, It highlights the setAttribute function in jQuery JS and says: Not Implemented
I think IE7 doesn't support that, so i tried to work around it:
if(Object.prototype.hasOwnProperty('setAttribute')){
$(e).attr(key, value);
}else{
e[key] = value;
}
It's still telling me:
Object doesn't support this action
What's the solution for this?
setAttributemethod is certainly not defined on theObject.prototypeobject... It's defined on the Element interface of the DOM standard.$(e).attr(key, value);should work in IE7.