[jQuery] removeClass() did not work?? [u]
Please have a look at the simple attached example. It's no problem to
addClass("big")
to the a-tags but removeClass("big") didn't remove the class or didn't apply
the change
to the elements. The problem is on IE6, Mozilla1.8 and FireFox 1.5.
Is this a bug or did I miss something?
Regards, Stefan Flick
simple example file:
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
<!--
function decorate() {
$("a:fett").addClass("big");
}
function undecorate() {
alert("undeco");
$("a").removeClass("big");
}
function onLoadAction() {
$("input#decorate").click(decorate);
$("input#undecorate").click(undecorate);
$("input#decorate1").click(function(){$("a").addClass("big");});
$("input#undecorate1").click(function(){$("a").removeClass("big");});
}
$(document).ready(onLoadAction);
//-->
</script>
<style>
a { font:10pt verdana; }
.big { font:bolder 10pt verdana; color: #ff0000; }
</style>
</head>
<body>
<a href="http://jquery.com/">jQuery</a>
<a href="http://www.verflickst.de">verFLICKst.de</a>
<div id="buttons">
<input id="decorate" type="button" value="decorate
function">
<input class="big" id="undecorate" type="button"
value="undecorate function">
<input id="decorate1" type="button" value="decorate inline">
<input class="big" id="undecorate1" type="button"
value="undecorate inline">
</div>
</body>
</html>
********************************************
*** Stefan Flick
*** 2333 Leopoldsdorf b. Wien
*** Austria
********************************************
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/