There's a similar answer here but it's somehow different and doesn't fit my case, I can't just do a join():
an array of strings as a jQuery selector?
I have a dynamic array that looks like this,
['abc', 'def', 'ghi']
I need to do a Selector string as follows including all these values as a data-event attribute as follows:
$('li.event[data-event="' + /*every element from the array*/ + '"]');
Is there a way to avoid looping?
data-eventyou're trying to match with?data-eventneeds to be included in the Selector string shown. That is my selector. e.g.:.event[data-event="abc"], .event[data-event="def"], .event[data-event="ghi"].