我想要在一个
<li>
元素内获取一个 <p>
的文本值。
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"];
}
如何做到这一点?