This code defines an SVG canvas element and three buttons that allow the user to add circles, rectangles, or clear the canvas. When the user clicks the "Add Circle" button, the addCircle()
function creates a new <circle>
element with a random position and a blue fill color, and appends it to the canvas. When the user clicks the "Add Rectangle" button, the addRect()
function creates a new <rect>
element with a random position and a red fill color, and appends it to the canvas. When the user clicks the "Clear Canvas" button, the clearCanvas()
function removes all child elements from the canvas. You can modify the code to add more shapes or editing functions as desired.