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.
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

If you want to remove the div completly from the div here is some code for that nicely explained:
All Courses

From novice to tech pro — start learning today.