怎么加了一个判断就不能隐藏文件了?
<input type="button" value="隐藏文本" onclick="hide()">
function hide(){
var x=confirm("确定隐藏文本?");
if(x==ture){
var b=document.getElementById("txt");
b.style.display="none";
}}else{
document.write("取消隐藏");
}
主体代码就是这个了,之前没有confirm这个判断的时候,可以进行文本隐藏,加了这个就不行了