Reputation: 221
$('del, .set-ui-icon-15x41-new:has(:parent+div:has(ins))').toggle(500);
Basically I'm looking to toggle all del
tags, and span
s which have the class name of 'set-ui-icon-15x41-new' that have a parent which contains a child div that has an ins
tag.
To simplify; this doesn't work either:
$('.set-ui-icon-15x41-new:parent')
But this does...
$('.set-ui-icon-15x41-new').parent()
So how can I get the :parent
selector to work?
Upvotes: 2
Views: 165
Reputation: 4521
:parent will select elements that are parents, not the parent of the element.
Possible solution:
$(':has(ins) > .set-ui-icon-15x41-new')
Demo:
Updated demo after comments:
Upvotes: 5