Hello, I am looking to apply CSS to a parent element based on its child.
<li>
<div>
<label>
<b style="display: none;">Name and Date of Event*: </b>
</label>
</div>
</li>
I want to hide the list item, but I am unsure how to achieve this with CSS.
Currently, I am using:
jQuery("b:contains('Name and Date of Event*:')").css('display','none');
However, this only hides the <b>
tag. I would like to hide the entire parent li
element.
Is it possible to hide a parent element based on a child? If so, how can I achieve this?