get every element with data value jquery code example
Example 1: jquery select by data attribute
$('div[data-key=value]');
Example 2: get all data attributes jquery from multiple elements
var allAttributes = jQuery('.class').map(function() { /* example: .class */
return jQuery(this).data('id'); /* example: id */
}).get();
/* Returns all attributes witin an array like: ["1", "2", "3", "4"] */
console.log(allAttributes);