slightly shorter, using querySelectorAll
and querySelector
document.querySelectorAll('.athing').forEach(el => { if (el.querySelector('.titleline').innerText.match(/gpt/i)) { el.hidden = true; el.nextElementSibling.hidden = true; el.nextElementSibling.nextElementSibling = true; } });
also, is the last one supposed to have hidden
too? so maybe
document.querySelectorAll('.athing').forEach(el => { if (el.querySelector('.titleline').innerText.match(/gpt/i)) { el.hidden = true; el.nextElementSibling.hidden = true; el.nextElementSibling.nextElementSibling.hidde