Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery hide() method do show element with display:none !important

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?

like image 680
Pupil Avatar asked Sep 25 '13 09:09

Pupil


People also ask

What does hide () do in jQuery?

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.

Is jQuery hide same as display none?

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.

How do you do show hide in jQuery?

Syntax: $(selector).hide(speed,callback); $(selector).show(speed,callback);


1 Answers

$('.cls').attr('style','display:block !important'); 

DEMO

like image 57
A. Wolff Avatar answered Sep 25 '22 06:09

A. Wolff