How do I remove an HTML tag using JavaScript?
For example, with insertAfter (); and the insertBefore (); I can insert some tags if I want. But if I want to erase from my code, some TAG? Not by display: none, I want to delete myself.
I found remove () but it does not work in all browsers.
Example
<div class="1">Div 1</div>
<div class="2">Div 2</div>
<div class="3">Div 3</div>
<div class="4">Div 4</div>
In case, if I wanted to delete the div 3? How do I do? Remove it from HTML, look like this:
<div class="1">Div 1</div>
<div class="2">Div 2</div>
<div class="4">Div 4</div>