<script type="text/javascript">
function openwindow(){
var mymessage=confirm("是否打开网页");
if(mymessage==true)
{ window.open(url,"http://www.imooc.com/","_blank","width=400,height=500, menubar=no, toolbar=no");
}
else{alert("再见");
}
}
</script>
function openwindow(){
var mymessage=confirm("是否打开网页");
if(mymessage==true)
{ window.open(url,"http://www.imooc.com/","_blank","width=400,height=500, menubar=no, toolbar=no");
}
else{alert("再见");
}
}
</script>
/定义"取消设置"的函数
function change_exit(){
var exittext=confirm("是否取消设置");
if(exittext==true){
myObj1.removeAttribute("style");
}
}
function change_exit(){
var exittext=confirm("是否取消设置");
if(exittext==true){
myObj1.removeAttribute("style");
}
}
var myObj=document.getElementById("con");
//定义"改变颜色"的函数
function change_color(){
myObj.style.color="green";
myObj.style.backgroundColor="red";
}
//定义"改变颜色"的函数
function change_color(){
myObj.style.color="green";
myObj.style.backgroundColor="red";
}
以下是我的设置,已经试了,没有问题;我反来发,可以从上到下看。input的onclick名字再分别设一下就行了。大家继续加油了
<script type="text/javascript">
var settxt=document.getElementById("txt");
//定义"改变颜色"的函数
function change_color(){
settxt.style.color="red";
settxt.style.backgroundColor="orange";
}
<script type="text/javascript">
var settxt=document.getElementById("txt");
//定义"改变颜色"的函数
function change_color(){
settxt.style.color="red";
settxt.style.backgroundColor="orange";
}
//定义"改变宽高"的函数
function change_size(){
settxt.style.width="300px";
settxt.style.height="400px";
}
//定义"隐藏内容"的函数
function hidden_txt(){
settxt.style.display="none";
}
//定义"显示内容"的函数
function display_txt(){
settxt.style.display="block";
}
function change_size(){
settxt.style.width="300px";
settxt.style.height="400px";
}
//定义"隐藏内容"的函数
function hidden_txt(){
settxt.style.display="none";
}
//定义"显示内容"的函数
function display_txt(){
settxt.style.display="block";
}
<script type="text/javascript">
var mywin=window.open("www.");
mywin.close();
</script>
var mywin=window.open("www.");
mywin.close();
</script>
2015-11-21
关闭新打开的窗口:
<script type="text/javascript">
var mywin=window.open("http://www..com");
mywin.close();
</script>
<script type="text/javascript">
var mywin=window.open("http://www..com");
mywin.close();
</script>
2015-11-21
<script type="text/javascript">
// document.write("开启JS之旅!I will be success!");
</script>
</head>
<body>
<p id="p1">开启JS之旅,I will be success!</p>
<script>
document.getElementById("p1").style.color="red";
</script>
中间加的代码,贴出来,刚开始学习js
// document.write("开启JS之旅!I will be success!");
</script>
</head>
<body>
<p id="p1">开启JS之旅,I will be success!</p>
<script>
document.getElementById("p1").style.color="red";
</script>
中间加的代码,贴出来,刚开始学习js
2015-11-20