I have this simple <div>
:
<div id='myId' class='hide'>...</div>
I want to show it using the class show
.
$("#myId").show();
It doesn't work, the <div>
keeps the hide
class.
You can use toggleClass()
as follows:
$("#myId").toggleClass("hide show");
or
$("#myId").removeClass("hide").addClass("show");