Home › Forums › CSS › To select a specific parent tag. › Re: To select a specific parent tag.
November 12, 2012 at 4:04 pm
#114069
Senff
Participant
You can use jQuery, I’d say:
$(‘.apple’).parent().addClass(‘highlight’);
This will add a class “highlight” to the LI if it contains a child with class “apple”. Sounds kinda obvious, but the fact that it wasn’t suggested already makes me wonder if there’s something wrong with it…..?