technically speaking , Ryand answered this. CSS has no content selectors.
I am curious, why would you ever need to hide something based on content (or rather if you knew you needed to hide that content for some nefarious reason, it might be simpler to add a class to the element.
other than that you could cheat. That is, you can’t select based on content, but you can select based on VALUE.
which means if you could create hidden inputs, with the value of the content to hide, PRIOR to you event and then use [value=] and adjacent selector to hide the element.
eg.:
input[value="some content i want hidden"]+* { display:none; }
of course this is just unnecessarily convoluted, since, if you could know the content and alter the source by builiding a hidden input, why not just add a class?
Just guessing, but it sounds like it may be time for a bit of CREATE TABLE and / or ALTER TABLE to make things easier. No fault intended, unfortunately it is not easy to plan for the unknown and inconceivable
I was just curious, no specific need as of now; I am experimenting with a drupal site where some users might be “content editors” thus creating content, since drupal way of adding content is based on preset forms, and basically the output is predictable, I was thinking to kinda use a filtering method for few specific (forseeable) content that is going to be inside a paragraph.
I thought it would be easier in css, but since that’s not an option, I am open to both js and php.
Please note being just an experiment, and not knowing how to do it, I don’t expect you losing time on this, just say no, it’s perfectly understandable, unless you see it as a challenge, and want to experiment yourself.