rishabh dev rishabh dev - 2 months ago 5
Javascript Question

reliabilty of 'isConnected' field in dom node

domNode.isConnected
is a flag which is available in chrome. It shows whether domNode is part of the document.
Is it cross browser compatible?
If not is there any efficient alternative for this for other browsers?
Please provide link for any available documentation.

Answer

A quick test shows Firefox doesn't support this property. So the answer is no.

var input = document.getElementById('input');
alert(input.isConnected);
<input type="text" id="input">

https://jsfiddle.net/hu08awn0/

Comments