I have assigned an element a class which has following CSS:
.cls { display:none !important; }
When I try to show this element with jQuery
$(".cls").show();
It does not work.
How can I hide this element?
The hide() method hides the selected elements. Tip: This is similar to the CSS property display:none. Note: Hidden elements will not be displayed at all (no longer affects the layout of the page). Tip: To show hidden elements, look at the show() method.
hide(): "The matched elements will be hidden immediately, with no animation. This is roughly equivalent to calling . css('display', 'none'), except that the value of the display property is saved in jQuery's data cache so that display can later be restored to its initial value.
Syntax: $(selector).hide(speed,callback); $(selector).show(speed,callback);
$('.cls').attr('style','display:block !important');
DEMO
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