Answers for "how to get data-content js"

0

javascript get data-id attribute

//get data-id attribute in plain Javascript
var element = document.getElementById('myDivID');
var dataID = element.getAttribute('data-id');

//get data-id using jQuery
var dataID = $('myDivID').data('data-id');
Posted by: Guest on July-31-2019
0

data id tag

var dataId = $(this).attr("data-id");
Posted by: Guest on March-11-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language