How to remove existing div tag, if I draw another div tag over the existing one using JavaScript?

I have already draw one div using Java Script in my html page. But I require to delete this div tag if I am drawing any other div over the existing div. Right now it is just overlapping.
binesh_michaelAsked:
Who is Participating?
 
Oddsen84Connect With a Mentor Commented:
This should make it invisible. But it doesn't remove it from the source code.
document.getElementById('element_name').display = 'none';

Open in new window

0
 
Oddsen84Commented:
If you want to remove the div completly from the div here is some code for that nicely explained:
http://www.dustindiaz.com/add-and-remove-html-elements-dynamically-with-javascript/
0
All Courses

From novice to tech pro — start learning today.