How can I remove or replace SVG content? October 11, 2022 by Tarik Here is the solution: d3.select("svg").remove(); This is a remove function provided by D3.js.