How to remove a class that has been appended to a div id? Earlier I appended a star to a label,when a checkbox is click.
$("<span class='req'><em> * </em></span>").appendTo("#displayPanel #labelstr"+div_id);
Now,if the same checkbox is clicked again I want to remove that star.
I know there is a remove() option, but what is the proper code for it?
Please guide me.
By the looks of it, you’re not trying to remove a class which would be the
removeClass()command, but instead need to remove a child element from a<div>You could do
to remove the child span element with class ‘req’ from the
<div>.