I'm writing a chrome extension, that when you hit a button, an element is deleted. I've tried a lot, and no results. I've done document.getElementsByClassName('GDhqjd').remove()
and it's not defined. I've also done var nam = document.getElementsByClassName('GDhqjd')
and then remove(nam)
but remove becomes "undefined" I can't find a solution anywhere. How would I get the js to delete the elements?
Full Code
function myFunction() {
document.getElementsByClassName('GDhqjd').remove()
}
document.getElementById("myButton").addEventListener("click", myFunction);