Q: get coordinates of an SVG element how it is possible to find the coordinates of an svg element?
I want to add a <rect/> with JS which should cover the <g class="m"/>, so I need to find out the coordinates of the <g>.
I read this post, but it is not for working with JS and this looks to be only for x an y, but I need height and width as well.
<svg class="definition-scale" viewBox="0 0 37960 22350">
        <g class="page-margin" transform="translate(200, 200)">
            <g class="system" id="system-0000000388984586">
                <path d="M2190 720 L2190 6170" stroke="#000000" stroke-width="27"/>
                <use height="720px" width="720px" x="2010" xlink:href="#E003" y="720"/>
                <use height="720px" width="720px" x="2010" xlink:href="#E004" y="6170"/>
                <rect fill="rgba(207, 187, 250, 0.4)" height="?" width="?" x="?" y="?"/>
                <g class="m" id="m2">more child elements </g>
                <g class="m" id="m3">...</g>
            </g>
        </g>
    </svg>

