function add5(){
var add5=confirm("是否取消设置?")
if(add5==true)
{
document.getElementById("txt").removeAttribute("style");
}
}
//为什么大神跟我写的都不一样
var add5=confirm("是否取消设置?")
if(add5==true)
{
document.getElementById("txt").removeAttribute("style");
}
}
//为什么大神跟我写的都不一样
最赞回答 / microzz
<!DOCTYPE html><html> <head> <title> new document </title> <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> <script type="text/javascript"> function openWindow(){ // 新窗口打开时弹出确认框,是...
2016-05-13
//定义"隐藏内容"的函数
function hide(){
div.style.display = 'none';
}
//定义"显示内容"的函数
function show(){
div.style.display = 'block';
}
//定义"取消设置"的函数
function cancel(){
if(confirm('是否取消设置?')){
h2.removeAttribute('style');
div.removeAttribute('style');
}
}
function hide(){
div.style.display = 'none';
}
//定义"显示内容"的函数
function show(){
div.style.display = 'block';
}
//定义"取消设置"的函数
function cancel(){
if(confirm('是否取消设置?')){
h2.removeAttribute('style');
div.removeAttribute('style');
}
}
var h2= document.getElementById('con');
var div = document.getElementById('txt');
function color(){
h2.style.color='red';
h2.style.backgroundColor='#CCC';
}
function width(){
div.style.width='288px';
div.style.height='288px';
}
var div = document.getElementById('txt');
function color(){
h2.style.color='red';
h2.style.backgroundColor='#CCC';
}
function width(){
div.style.width='288px';
div.style.height='288px';
}
function add(){
var p1 = document.getElementById("p1");
p1.className = 'one';
}
function modify(){
var p2 = document.getElementById("p2");
p2.className = 'two';
}
var p1 = document.getElementById("p1");
p1.className = 'one';
}
function modify(){
var p2 = document.getElementById("p2");
p2.className = 'two';
}
2016-05-13
function hidetext(){
var mychar = document.getElementById("con");
mychar.style.display = 'none';
}
function showtext(){
var mychar = document.getElementById("con");
mychar.style.display = 'block';
}
var mychar = document.getElementById("con");
mychar.style.display = 'none';
}
function showtext(){
var mychar = document.getElementById("con");
mychar.style.display = 'block';
}
2016-05-13
一开始看到p1的开始标签里头没有class还以为程序出bug了要自己改,原来不写出来不等于没有,在function add()里头照改,点击后的效果也一样(灰底红字)
2016-05-13