Я хочу иметь текстовое значение от <p> внутри элемента <li>.
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"];
}
Как это сделать?