Javascript examples for DOM HTML Element:SVG
Scaling a circle in SVG
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> console.clear(); function scale() {/*from w w w . j ava 2 s . co m*/ document.querySelector("#container > circle").setAttribute('transform', 'scale(1.5,1.5)'); } </script> </head> <body> <svg height="150" width="150" id="container"> <circle cx="25" r="20" cy="20" fill="blue" id="circle"></circle> </svg> <button id="zoom" onclick="scale()">scale</button> </body> </html>