Obtener texto de párrafo dentro de un elemento
Quiero tener el valor de texto de una<p>
dentro de una<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 hacer esto?