jquery get data attribute value
/* html */ <a data-id="123">link</a> /* js */ $(this).attr("data-id") // returns string "123" $(this).data("id") // returns number 123 (jQuery >= 1.4.3 only)
Source: stackoverflow.com
jquery select by data attribute
$('div[data-key=value]');
jquery select element with data
$('[data-attribute="value"]');
Source: stackoverflow.com
jquery data attribute
/* html */ <a data-number="123">link</a> /* js */ $(this).attr("data-number") // returns string "123" $(this).data("number") // returns number 123 (jQuery >= 1.4.3 only)
Source: stackoverflow.com
find element with data attribute jquery
$("ul").find(`[data-slide='${current}']`)
jquery get element by data attribute
$("ul[data-slide='" + current +"']");
Source: stackoverflow.com