<svg>
<g id="g1" transform="translate(100 80)"/>
</svg>
<script>
var tr_value = document.getElementById("g1").getAttribute("transform");
alert(tr_value); // result: translate(100 80) need: 100
</script>
Hi to experts, tell me how to get the value of the attribute parameter in case the attribute has several parameters, and they, in turn, have several values. In the example above, I would like to get a value of 100 into a variable. I really hope that in Javascript there is a beautiful method for this. And then the first thing that comes to mind is to parse text or regular expressions.