Graphics on the Web
<!DOCTYPE html> <html> <head> </head> <body> <script> // Canvas: paint pixels, then the shape is forgotten ctx.beginPath(); ctx.arc(50, 50, 20, 0, Math.PI * 2); ctx.fill(); // clicking it does nothing on its own — you'd test coordinates yourself // SVG: the shape is a living element const circle = document.querySelector('circle'); circle.addEventListener('click', () => console.log('clicked!')); </script> </body> </html>