Horje
jquery get data attribute value Code Example
jquery get data attribute value
/* html */
<a rel="nofollow" data-id="123">link</a>

/* js */
$(this).attr("data-id") // returns string "123"

$(this).data("id") // returns number 123 (jQuery >= 1.4.3 only)
jquery select by data attribute
$('div[data-key=value]');
jquery select element with data
$('[data-attribute="value"]');
jquery get data-id
const dataId = $('#elementId').attr("data-id");
jquery set data attribute value
//<div id="myElementID" data-myvalue="37"></div>
var a = $('#myElementID').data('myvalue'); //get myvalue
$('#myElementID').data('myvalue',38); //set myvalue
find element with data attribute jquery
$("ul").find(`[data-slide='${current}']`)




Javascript

Related
chart js hide legend Code Example chart js hide legend Code Example
uppercase angular pipe Code Example uppercase angular pipe Code Example
moment add 30 days Code Example moment add 30 days Code Example
jquery remove string from string Code Example jquery remove string from string Code Example
border react native Code Example border react native Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7