Absatztext in einem Element abrufen
Ich möchte den Textwert von a haben<p>
in einem<li>
Element.
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"];
}
Wie macht man das?