老师innerText不是不支持火狐吗?视频中运行是undefind:我在火狐运行是可以的啊,
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="../domReady.js"></script>
<script type="text/javascript">
myReady(function(){
var content=document.getElementById("content");
console.log(content.innerText);
//写入值的时候
//content.innerText="<p>This is a paragraph</p>"
});
</script>
</head>
<body>
<div id="content">
<p>This is a <strong>paragraph</strong> with a list following it.</p>
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
</div>
</body>
</html>
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星