There is a dedicated instanceof statement that checks if an object has a constructor prototype in the prototype chain:
node instanceof SVGElement
However, given that you really cannot do new SVGElement() (as with all node constructors), this may not work reliably in all browsers.
source share