Obter texto de parágrafo dentro de um elemento
Eu quero ter o valor do texto de um<p>
dentro de um<li>
elemento.
html:
<ul>
<li onclick="myfunction()">
<span></span>
<p>This Text</p>
</li>
</ul>
javascript:
function myfunction() {
var TextInsideLi = [the result of this has to be the text inside the paragraph"];
}
Como fazer isso?