Can someone help me with the syntax of what I'm trying to do here?
jQuery('(div[data-positiontype="3"]) && (div[data-positiontitle*="test"] || div[data-positiondesc*='test'])')
Basically I need the ability to select all divs that have a specific attribute "data-positiontype" and a token in the attribute "data-positiontitle" or the attribute "data-positiondesc".
$('div[data-positiontype="3"]').filter('[data-positiontitle*="test"], [data-positiondesc*="test"]').
or simply:
$('div[data-positiontype="3"][data-positiontitle*="test"], div[data-positiontype="3"][data-positiondesc*="test"]').
You add selectors together to find elements that match both, and use a combinator ,between the selectors:
,
jQuery('div[data-positiontype="3"][data-positiontitle*="test"],div[data-positiontype="3"][data-positiondesc*="test"]')