Home > OS >  jQuery hide div that contains certain text
jQuery hide div that contains certain text

Time:12-18

On my website I have 3 types of employees

  • barista
  • barista01
  • security and I would like to hide the barista01 option but leave the others as they are (please refere to the picture).

When i try to use $("div:contains('barista01')").parent('div').hide(); I get a full black window hiding everything inside. Is there anyway how to fix this?

Thank you in advanced enter image description here

CodePudding user response:

If Class name ".hc-mt3" is fixed and will not change then you can target that class. See Example Code: $("div:contains('barista01')").parent('.hc-mt3').hide();

  • Related