这里小小的提示下 getElementById(); 这里的I是大写,所以这里的答案就是,document.getElementById("con"); 这样就对了
2016-07-09
var b=confirm("你玩英雄联盟还是CF?")
if(b==true){document.write("英雄联盟")
var c=confirm("英雄联盟好玩儿吗?")
if(c==true){document.write("好玩")}
else{
document.write("不好玩")}}
else{document.write("CF")
var d=confirm("CF好玩儿吗?")
if(d==true){document.write("好玩儿")}
else{
document.write("不好玩儿")}}
if(b==true){document.write("英雄联盟")
var c=confirm("英雄联盟好玩儿吗?")
if(c==true){document.write("好玩")}
else{
document.write("不好玩")}}
else{document.write("CF")
var d=confirm("CF好玩儿吗?")
if(d==true){document.write("好玩儿")}
else{
document.write("不好玩儿")}}
2016-07-09
这是按钮的部分的
<input type="button" onclick="color()"value="改变颜色" >
<input type="button" onclick="gaibian()"value="改变宽高" >
<input type="button" onclick="noxian()"value="隐藏内容" >
<input type="button" onclick="yesxian()"value="显示内容" >
<input type="button" onclick="rec()"value="取消设置" >
<input type="button" onclick="color()"value="改变颜色" >
<input type="button" onclick="gaibian()"value="改变宽高" >
<input type="button" onclick="noxian()"value="隐藏内容" >
<input type="button" onclick="yesxian()"value="显示内容" >
<input type="button" onclick="rec()"value="取消设置" >
接着来= =
//定义"隐藏内容"的函数
function noxian(){
var hide = document.getElementById("txt");
hide.style.display="none";
}
//定义"显示内容"的函数
function yesxian(){
var show = document.getElementById("txt");
show.style.display="block"
}
//定义"隐藏内容"的函数
function noxian(){
var hide = document.getElementById("txt");
hide.style.display="none";
}
//定义"显示内容"的函数
function yesxian(){
var show = document.getElementById("txt");
show.style.display="block"
}