deno-dom
deno-dom copied to clipboard
Add HTMLUnknownElement
I'm trying to figure out if the HTMLElement, or Element in this case, returned from document.createElement
is a valid HTML tag. At first the internet suggested I stringify the tag as in the browser the string ends up being [object HTMLUnknownElement]
for any invalid Element created, but this doesn't seem to work with deno-dom as it seems to get stringified to [object EventTarget]
instead. The next suggestion I found was to try tag instanceof HTMLUnknownElement
which does also work in the browser, but from what I can see in the documentation, isn't available here.
If you know of another way to validate weather an Element is a valid HTML tag then I'm all ears, but otherwise I'm asking if you could add support for this.
Yeah, this is a known issue. It basically depends on #128, #73 (and by extension #81), and #4. I need to find some time to implement those so that Deno DOM doesn't see everything as just an Element