Is there a function like document.getElementById(\"FirstDiv\").clear()
?
You should probably use a JavaScript library to do things like this.
For example, MochiKit has a function removeElement, and jQuery has remove.
You should be able to use the .RemoveNode method of the node or the .RemoveChild method of the parent node.
child.remove()
For your use case:
document.getElementById("FirstDiv").remove()
This is recommended by W3C since late 2015, and is vanilla JS. All major browsers support it.
Mozilla Docs
Supported Browsers - 96% May 2020