最赞回答 / calloy
因为,document.getElementById获取对象的时候,返回的是符合要求的第一个对象。document.getElementsByTagName和document.getElementsByName返回的则是所有符合要去的对象。
2015-07-15
javascript 作为一种脚本语言,可以放在html页面中的任何位置,根据执行先后顺序,合理地放置JavaScript的位置。
2015-07-15
html---> <script src="??,js"></script>
js ---> document.write("??????");
js ---> document.write("??????");
2015-07-15
<script type="text/javascript">
document.write("开启JS之旅!");
</script>
document.write("开启JS之旅!");
</script>
2015-07-15
希望在前方,努力!分号忘记写了
document.write("hello JavaScript");
document.getElementById("p1").style.color="blue";
document.write("hello JavaScript");
document.getElementById("p1").style.color="blue";
2015-07-15
已采纳回答 / arlenhui
1,推荐用runjs,condepen打开很慢。2,两个错误,一个是input的onclick函数需要括号,二是js中display书写错误http://runjs.cn/detail/yn2u1qr0
2015-07-15
已采纳回答 / 奔跑的Q丶
在你的else之前再加两端代码<...code...>你要理解prompt的返回值。你可以自己更改一下这两个条件下的输出,分别感受一下什么都不输入时点击“确定”和“取消”的区别。
2015-07-15
var my =prompt("请输入要打开的网址");
if(my==""){
window.open('http://www.imooc.com/','_blank','width=400,height=500,menubar=no,toolbar=no');
}
else{
window.open(my,'_blank','width=400,height=500,menubar=no,toolbar=no');
}
if(my==""){
window.open('http://www.imooc.com/','_blank','width=400,height=500,menubar=no,toolbar=no');
}
else{
window.open(my,'_blank','width=400,height=500,menubar=no,toolbar=no');
}