I'm trying to get the value of an element child. Here is the element :
<li id="1" style="display:normal">
<h2 id="label_lg">Temp Set (º<span class="degsign">C</span>)</h2>
<p id="ihi" style="color:teal;font-size:3vw;">--</p>
</li>
I would like to get the value of <p></p>, if possible in javascript. I've tried to use
document.getElementById(1).childNodes[1].nodeValue;
and
var o = document.getElementById(i).children
o[1].nodeValue
Nothing worked, the alert always returns null.
innerHTMLorinnerTextor eventextContentdocument.querySelector('#1 p').innerHTMLstyle="display:normal"supposed to be?normalis not a valid CSS property fordisplay.