how to get name attribute from dom in javascript code example
Example: javascript get attribute
//HTML
//
var elem = document.getElementById("elem");
elem.getAttribute("data-id"); // "4hJ3s"
//HTML
//
var elem = document.getElementById("elem");
elem.getAttribute("data-id"); // "4hJ3s"