Hi there, I would like to hide some elements if a div with class ms-searchref-categoryname text contains Job:
<div class="ms-searchref-categoryname">Job</div>
<ul><li></li></ul>
<a href=""><div class=""></div></a>
How can this be done?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As you said “if div text contains something”, you can use this:
This will hide the element if the string “Job” is found anywhere in the selected element. Here’s a working example.
Alternatively, without the use of the
:containspseudo-selector:On the other hand, if you meant you wanted to hide an element if a
divonly contains a specified string, then @Headshota has given you a working answer already.