The following code has a weird quirk:
function createSVG(){ let svgarea = document.getElementById("svgarea"); let svg = document.createEleme