JSFiddle - React, Tailwind, and code Playground

HTML

<svg>
  <g id="g"></g>
</svg>

JavaScript

const g = document.querySelector("#g");

if (g instanceof SVGGElement) {
	console.log("ok");
}