How to get the height of elements under svg

background: d3.js draws a tree with zoom, and the screen will not display when enlarged, so that the downloaded picture will not be fully displayed. So, you want to get the width and height of g under svg

<svg>
    <g class="content">
        ...
    </g>
</svg>

question: cannot be obtained by using the method of jquery. Width (). How can I get the correct value?

Svg
Mar.20,2021

<svg>
    <g class="content" id="g1>
        ...
    </g>
</svg>
<script>
var boxInfo = document.getElementById('g1').getBBox();
var rectInfo = document.getElementById('g1').getBoundingClientRect();

console.log(boxInfo, rectInfo);
</script>
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b323a0-2bddd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b323a0-2bddd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?