t.getAttribute error on Adobe Dynamic Tag Manager
I am trying to figure why the following piece of code generates the "SATELLITE: TypeError - t.getAttribute is not a function". The getElementbyClassName returns an array of object but cannot seem to understand why I get the latter error.
var checkmarks = document.getElementsByClassName('togglePanel
btn-selector togglePanelCheckmark');
var currentCheckmark = "";
// Iterating through all the checkmarks
for (var i = 0; i < checkmarks.length; i++) {
var classList = checkmarks[i].classList;
if(classList.value.indexOf('active') !== -1) {
currentCheckmark = (checkmarks[i].id.split('-')[2]).split('_')[0] + ':
' + checkmarks[i].innerText;
}
}
return currentCheckmark;
Any help would be appreciated.