I want to have the text value from a <p> inside a <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\"];
}
How to do this?





Rating:
The post javascript – Get paragraph text inside an element appeared first on Javascript ASK.
via Javascript ASK http://javascriptask.phpfogapp.com/javascript-get-paragraph-text-inside-an-element.html
No comments:
Post a Comment