Add a new class to the icheck-helper class with jQuery

243 Views Asked by At

Using the iCheck plugin in JQuery, I am trying to add a new CSS class to the iCheck-helper element. I tried as follows:

$('.iCheck-helper').addClass('abc');

However it doesn't work.

1

There are 1 best solutions below

1
Bibberty On

Here is how is can be done in vanilla javascript.

Hope this helps.

document.querySelector('.classOne').classList.add('classTwo');
.classOne {
  color: blue;
}

.classTwo {
  font-weight: bold;
}
<div class="classOne">Test</div>