#10136 closed bug (duplicate)
.removeAttr has problems in chrome
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | None |
Component: | attributes | Version: | 1.6.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
When executing this code http://jsfiddle.net/pjabT/ which contains
<ul> <li id="a">
<p>In Chrome this text will turn red and stay red. Why?</p> <span id="s" style="">Text</span>
</li> </ul> for the HTML
and
var t = true;
setInterval(function(){
t = !t; if(t){
$('#s').css('color','rgb(255, 0, 0)');
} else {
$('#s').removeAttr('style');
}
}, 1000);
for the Javascript Chrome will not remove the style attribute or reset it. Works with FF and IE.
Change History (3)
comment:1 Changed 11 years ago by
Component: | unfiled → attributes |
---|---|
Priority: | undecided → high |
Resolution: | → duplicate |
Status: | new → closed |
comment:2 Changed 11 years ago by
comment:3 Changed 11 years ago by
I can reproduce this in Chromium 12.0.742.112 (90304) for Ubuntu 10.04
This is true also in jQuery 1.6.1 !
I found a workaround that can be tested here : http://jsfiddle.net/qbPW9/1/
The implied correction in jquery-1.6.2 would be to add the line (2279) :
>> elem.setAttribute( name, "" ); elem.removeAttribute( name );
Duplicate of #9699.