//定义"取消设置"的函数
var cancle = function(){
if(confirm("是否确定?")){
document.getElementById("txt").removeAttribute("style");
}
}
var cancle = function(){
if(confirm("是否确定?")){
document.getElementById("txt").removeAttribute("style");
}
}
<script type="text/javascript">
document.write("I");
document.write("love");
document.write("papi酱");
</script>
document.write("I");
document.write("love");
document.write("papi酱");
</script>
2016-03-03
<!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