I am trying to hide all elements of classing in a dom using jquery.
In my case this works:
document.getElementsByClassName('hc-block hc-theme-nice-link hc-nowrap')[6].style.visibility='hidden'
but I want to hide all the elements (not just the 7-th one) and I would like to use Jquery
Tried this:
$(".hc-block hc-theme-nice-link hc-nowrap").css("visibility", "hidden");
but it does not work… Really dont understand why???
>Solution :
Your jquery selector will need class to define with ., and you want to select element with all mentioned class so do not add space between them. Try like below.
$(".hc-block.hc-theme-nice-link.hc-nowrap").css("visibility", "hidden");