<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="tezt/html; charset=utf-8" />
<title>热身</title>
</head>
<>
<html>
<head>
<meta http-equiv="Content-Type" content="tezt/html; charset=utf-8" />
<title>热身</title>
</head>
<>
2016-03-03
function openWindow(){
if(confirm("真的要打开吗尚坤")){
var addr=prompt("那就输入你的网址吧");
window.open(addr,'open','width=400,height=500,menubar=no,toolbar=no');
}else{
alert("已取消");
}
}
if(confirm("真的要打开吗尚坤")){
var addr=prompt("那就输入你的网址吧");
window.open(addr,'open','width=400,height=500,menubar=no,toolbar=no');
}else{
alert("已取消");
}
}
mychar.style.color="red";
mychar.style.backgroundColor="#CCC";
mychar.style.width="300px" ;
mychar.style.backgroundColor="#CCC";
mychar.style.width="300px" ;
2016-03-03
var mychar= document.getElementById("con");
mychar.style.color="red";
mychar.style.backgroundColor="#ccc";
mychar.style.width="300px";
mychar.style.color="red";
mychar.style.backgroundColor="#ccc";
mychar.style.width="300px";
2016-03-03
<script type="text/javascript">
function openWindow(){
var my=confirm("新窗口打开时弹出确认框");
if(my==true){
window.open("http://www.imooc.com/","_blank","width=400,height=500,toolbar=no,menubar=no")
}
}
</script>
function openWindow(){
var my=confirm("新窗口打开时弹出确认框");
if(my==true){
window.open("http://www.imooc.com/","_blank","width=400,height=500,toolbar=no,menubar=no")
}
}
</script>
已采纳回答 / 八宝米粥
也可以用visibility属性替换display属性,visibility="visible|hidden"。当取值为"hidden"时,元素虽然被隐藏了,但它仍然占据它原来所在的位置。
2016-03-03
已采纳回答 / weibo_胡图不糊涂dian_0
因为浏览器解析javascript是从上往下解析网页源代码的。JavaScript可以放到任何位置,如文档顶部,<head></head>标签之间,<body></body>内部也可以放在<html></html>外部。至于你所说的放在<head></head>里不行是你的代码的原因吧,还是你没定义或者调用?
2016-03-03
为什么给变量赋值是数字的时候没有双引号,而重复赋值是英文时就有双引号?这个有什么讲究吗?老师能不能帮忙给解说一下?求等
2016-03-03