this: document.getElementsByClassName('warningmessage').remove(); doesn’t work if you have multiple warningmessage elements on the page.
How can I just delete all elements with that class? do I have to use a for each? isn’t there a command to deleteall()?
thanks for your tips!
With plain JavaScript you can do this:
So you would first of all get the nodes you are interested in and afterwards iterate over them and remove them from their parents.
Sadly there is no
forEachmethod onNodeList. However, you could this: