kamome kamome - 1 year ago 65
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


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

Even better, do this