Menu
I’m trying to get the data-boxId attribute value in order of all items inside a continer…
I have this but it’s not working? can anyone help?
“`
function getItems(){
var ancestor = document.getElementById(‘container’),
descendents = ancestor.getElementsByTagName(‘div’);
for (i = 0; i < descendents.length; ++i) {
console.log(descendents[i]);
console.log(descendents[i].getAttribute(data-boxId));
}
}