Hbaecklund Hbaecklund - 3 months ago 26
CSS Question

Show hidden object with jquery

We have a hidden ribbon and I'd like to change

.hidden
css in order for it to be displayed. My jquery doesn't seem to solve it?

Html

<div id="alwaysInStockRibbon" class="ribbon-wrapper-productpage hidden">
Css


Css

.hidden {
display: none!important;
visibility: hidden!important;


My jQuery do not work.

$(".hidden").css({"display":"Block","visibility":"visible"});

Answer

You can remove your hidden class :

$(".hidden").removeClass("hidden");
.hidden {
    display: none!important;
    visibility: hidden!important;
 }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="alwaysInStockRibbon" class="ribbon-wrapper-productpage hidden">
  aaaaaaaaaa
</div>