If you want to remove elements in an HTML page based on a specific class using JavaScript, you can use the following JavaScript code.
var elements = document.getElementsByClassName(className);
for(var i = 0, length = elements.length; i < length; i++) {
if( elements[i].textContent == 'ClassIsmi'){
elements[i].style.display = 'none';
}
}

Share your experience
Got a question, a different solution or a note to add?
Log in or join us to write a comment.
Log in ↗︎Sign up ↗︎