เบราว์เซอร์สมัยใหม่รองรับ SVG ทั้งหมด สามารถสร้าง SVG ด้วย JavaScript โดย:
- สร้าง SVG document object model (DOM) ว่างเปล่า
- ใช้ attributes สร้างรูปทรง เช่น วงกลม สี่เหลี่ยม
var mySvg = "https://www.w3.org/2000/svg"; var myDoc = evt.target.ownerDocument; var myShape = svgDocument.createElementNS(mySvg, "circle"); myShape.setAttributeNS(null, "cx", 40); myShape.setAttributeNS(null, "cy", 40); myShape.setAttributeNS(null, "r", 30); myShape.setAttributeNS(null, "fill", "yellow");