TypeError: abc.getAttribute is not a function

Try this may be:

var abc = $(".map-marker:first")[0];
var xyz = abc.getAttribute("data-lat");
console.log(xyz);

Or this:

var abc = $(".map-marker:first");
var xyz = abc.data("lat");
console.log(xyz);

Leave a Comment