Cannot read property 'nodeValue' of null
18,135
nodeValue
will never be null
because without a value the node wouldn't exist.
Remove .nodeValue
from your code.
Author by
Nick
Updated on June 15, 2022Comments
-
Nick almost 2 years
I have XML:
<street></street>
or
<street>2813 Bla ave</street>
Javascript:
if ((xmldoc.getElementsByTagName('street')[i].firstChild.nodeValue != null)) { alert(1); } alert(2);
But the script doesn't work - Cannot read property 'nodeValue' of null