JavaScript隐藏/显示元素我怎么能隐藏‘编辑’-链接后,我按下它?此外,当我按编辑时,我还能隐藏“loremipsum”文本吗?<script type="text/javascript">function showStuff(id) { document.getElementById(id).style.display = 'block';}</script><td class="post"><a href="#" onclick="showStuff('answer1'); return false;">Edit</a><span id="answer1" style="display: none;"><textarea rows="10" cols="115"></textarea></span>Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum </td>
3 回答
慕尼黑5688855
TA贡献1848条经验 获得超2个赞
document.getElementById(id).style.visibility = "hidden";document.getElementById(id).style.visibility = "visible";
注style.visibility
style.display
添加回答
举报
0/150
提交
取消