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.
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 :-
Try this code:
if(!$("#your_label_id").is(":visible"))
$("#remove_class").removeClass("class_name");
try this:
if($("#lblid").css("display")==='none'){
$("#lblid").removeClass("hidden");//or $("#lblid").css("display","block")
}
use this code:
if($('label').is(':visible'))
{
// remove hidden class
$('.disp-block').removeClass('hidden');
}
© 2022 - 2024 — McMap. All rights reserved.