function resettext(){
var flag = confirm("是否取消所有设置");
if(flag==true){
var con = document.getElementById("con");
var txt = document.getElementById("txt");
con.removeAttribute('style');
txt.removeAttribute('style');
}
没有作用啊!
括号是成对出现的,最后缺个}。而且你把括号敲成了全角,改成半角即可。
function resettext(){
var flag = confirm("是否取消所有设置");
if(flag==true){
var con = document.getElementById("con");
var txt = document.getElementById("txt");
con.removeAttribute('style');
txt.removeAttribute('style');
}
}