Menu
hello. I am trying to save some elements as an array with objects but I cant get it to work.
This is what I have done so far
[CODE]
function getElements() {
var test= document.getElementsByClassName(“testclass”);
var len = test.length;
var arr= [];
for(var i= 0; i<len; i++){
arr.push({
id: test[i].id,
value: test[i].value,
title: test[i].title
},);
}
}