kamome kamome - 2 years ago 127
Javascript Question

How to remove div contents

I would like to refresh the content of a div tag. I create a map using Openlayer3. In my web there is a button to render a map into a div tag but every time I clicked the button another map is created following the last map. The goal is to remove the map showed showed into the div and render the new one. How can I do that ?

I tried


to erase the old one and render the new one but doesn´t work

Answer Source

If you want to remove the old map and make a new one, just remove the old map.

Even better, do this

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download