0

How do I remove the hidden class? In order to show the ribbon?

Html

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

Css

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

I've tried these below without success.

Jquery

$(".hidden").remove();
$(".hidden").removeClass();

https://api.jquery.com/remove/

https://api.jquery.com/removeClass/

Input?

Hbaecklund
  • 261
  • 1
  • 4
  • 16

5 Answers5

2

You need to pass classname as argument in removeClass method to remove it in matched set:

Remove a single class, multiple classes, or all classes from each element in the set of matched elements.

 $(".hidden").removeClass('hidden');
Milind Anantwar
  • 81,290
  • 25
  • 94
  • 125
1
$("#alwaysInStockRibbon").removeClass('hidden');
Dinesh Prajapati
  • 499
  • 3
  • 17
1

You have to tell, which class you want to remove.

$(".hidden").removeClass("hidden");
eisbehr
  • 12,243
  • 7
  • 38
  • 63
1

try this : removeClass method takes class name to remove. You can put space separated class name if want to remove multiple classes

$('.hidden').removeClass("hidden");
Bhushan Kawadkar
  • 28,279
  • 5
  • 35
  • 57
-2

or you can do something like this to show that ribbon:

$("#alwaysInStockRibbon").css('display','block');
fernando
  • 814
  • 1
  • 9
  • 24