I have drawn the circle using svg. And binds the window resize event. The actual svg circle radius is 200, svg width and height value is 500. When resize the window it should be resize using scaling.while increase the window size and decrease the window size. how to acheive this?
<body onresize="myFunction()">
<svg id='circle' height="500" width="500">
<circle cx="250" cy="250" r="200" stroke="black" stroke-width="3" fill="red" />
</svg>
</body>
function myFunction(){
var element = document.getElementById('circle');
element.setAttribute('transform', 'scale(0.9)')
}
Sample Link: https://jsfiddle.net/fNPvf/42891/