Is there a portable way to check if some element can accept and show childNodes, except checking tagName switch(node.tagName)
or alike? I need to implement some kind of d&d and I'd like to insert moved node in the nearest to document.elementFromPoint
position (where dragged node has been dropped). But, as I understand, it's meaningless to insert an element in the <img>
, for example, so I'll need to insertBefore
this img's parentNode in that case.
Of course, it is possible to check against tags list, but maybe there's more portable and simple solution?
Thank you