0
how to remove a parent class element using js
ive been trying to remove a parent class element so i can replace it with a new parent class with diffrent class id but i cant get it to work right i understand mostly how to remove a child element from a parent element but sadly the lesson doesnt tell you how to remove what im needing
5 Respostas
+ 2
use
element.parentNode.classList.remove("class-name");
https://code.sololearn.com/WbBEAW3F07D5/?ref=app
0
8down voteaccepted
this.parent().removeClass("playing");
$(this).closest('div').removeClass("playing")
0
you did this with qjuery right i need it to be in pure javascript
0
it just clicked for me thank you