【发布时间】:2012-07-22 22:52:38
【问题描述】:
我想在 <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"];
}
如何做到这一点?
【问题讨论】:
标签: javascript html paragraph