JSFiddle - React, Tailwind, and code Playground
HTML
<div class="xxx" data-name="quantity" data-value="2" data-id="80"></div>
JavaScript
$('div').filter(function(){
alert($(this).attr('data-name'));
});
<div class="xxx" data-name="quantity" data-value="2" data-id="80"></div>
$('div').filter(function(){
alert($(this).attr('data-name'));
});