I have a long list of items with a data-item attribute; e.g., something like:
<div class="store-event" data-event="12345"> ... </div>
I would like to collect all the data-event values into an array (jQuery or otherwise) and do that in a single line so it’s easy to enter in the developer console but I haven’t been able to figure that out. $(".store-event")
gets me the expected jQuery collection, but adding .data("event")
only gets me the first value.
Any slick ways to make this happen without having to iterate over the original collection?