var archiveGroup = document.getElementsByClassName('archive-group'); for (var i = 0; i < archiveGroup.length; i++) { if(archiveGroup[i].innerText == 'B Corp'){ archiveGroup[i].style.display = 'none'; } }