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