我有这样的问题:
<div id='stickyid' style='display:block; color:red'>happi</div>
After write :
<script type="text/javascript">
var thevalue = document.getElementById("stickyid").innerText;
document.write(""+thevalue+"");
</script>
Run Code Online (Sandbox Code Playgroud)
它可以在Chrome上运行,但不适用于Firefox和IE.我该如何解决?
尝试:
var thevalue = document.getElementById("stickyid").innerText || document.getElementById("stickyid").textContent;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
79 次 |
| 最近记录: |