The ownerSVGElement property of the SVGElement interface reflects the nearest ancestor svg element.
ownerSVGElement
MDN Reference