JQuery Get Data-ID
const dataId = $('#elementId').attr("data-id");
Chris PA
const dataId = $('#elementId').attr("data-id");
$(this).data("id") // will return the number 123
//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');
var dataId = $(this).attr("data-id");