I want to detect if a label
's display is none. If it is, then I'll remove the hidden
class from the label.
How can this be done in jQuery? I'm new with js & jQuery.
You can follow below code
if(!$("label").is(":visible"))
{
// remove hidden class
$("label").removeClass("hidden");
}
but if you have multiple labels in your code then try below
$("label").each(function(){
if($(this).is(":visible"))
$(this).removeClass("hidden");
});
try below code :-
if($("#labelID").is(":visible"))
{
// remove hidden class
$("#labelID").removeClass("hidden");
}
Demo :-
http://jsfiddle.net/avmCX/45/
Try this code:
if(!$("#your_label_id").is(":visible"))
$("#remove_class").removeClass("class_name");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With