Jquery Select Parent Element Based on Wildcard Data Value of Child Element

I have a parent elements like so:

<div class="attribute-item"></div>

Inside these is a single div element, and I want to only select the attribute-item div elements that have a child element with a “data-value” attribute that ends with “open-box”. So, one such div element has:

data-value="king-open-box"

data-value="queen-open-box"

I want the elements containing these, to be selected on the ending wildcard of “open-box”.

I plan on copying and removing these elements, after confirming they exist, and placing them elsewhere on the page.

Cheers!
Ryan

It seems that the attribute-ends-with selector is what you need there.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.