js中的 toUpperCase()中开头的u和c一定要大些

来源:互联网 发布:mac软件可以移动吗? 编辑:程序博客网 时间:2024/06/07 08:25

js中的 toUpperCase()中开头的u和c一定要大些


innerHTML中的最后html一定要大些。


在js中条调用HTML元素,HTML元素一定要在调用语句之前出现,否则无法调用。

eg:

<html>

<body>

<p id="p1"></p>

<script>

var str="i am file";

document.getElementById("p1").innerHTML=str;

</script>

</body>

</html>

如果

<html>

<body>

<script>

var str="i am file";

document.getElementById("p1").innerHTML=str;

</script>

<p id="p1"></p>

</body>

</html>

则无法调用。





0 0