I want to remove class in html code. So I use the removeClass
function in Jquery. However, it doesn't work. To be more specific in the code, I want to let the opacity of graph become 0(disappear) when I click remove button. However it does nothing. I don't know what's wrong there. Can anyone explain a little bit? Thanks in advance!
Here is Jsfiddle Link Here is real code:
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script type="text/javascript">
function remove_R() {
$(".me rect").removeClass("rect_obvious");
}
</script>
<style type="text/css">
.rect_style {
stroke:black;
stroke-width:5;
}
.rect_color_1{
fill:#FFC863;
}
.rect_obvious{
opacity:1;
}
.rect_none{
opacity: 0;
}
</style>
</head>
<body>
<svg class="me" width="145" height="65"><rect class="rect_style rect_color_1 rect_obvious" x="3" y="3" rx="20" ry="20" width="140" height="60" ></svg>
<button onclick="remove_R()">remove</button>
</body>
</html>