嗨,我有以下代码,我希望能够通过按下按钮来更改圆的半径,我不知道在样式后使用什么。在 document.getElementById("circle1").style.r="10"; 部分代码
<html>
<head>
<script>
function circle() {
document.getElementById("circle").style.r="50";
}
function circle1() {
document.getElementById("circle1").style.r="10";
}
</script>
</head>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" id="svg" >
<circle id = "circle" cx = "100" cy = "800" r = "30" stroke="blue" stroke-width = "2" fill = "black"/>
<circle id = "circle1" cx = "20" cy = "500" r = "30" stroke="blue" stroke-width = "2" fill = "black"/>
</svg>
<body>
Set size of circles
<input type="button" onclick="circle()" value="big" />
<input type="button" onclick="circle1()" value="small" />
</body>
</html>