一个JS的问题
function init(){
${"errors1"}.style.visibility = "hidden";
}
function validate(){
var name = document.forms(0).name.value;
NewsDao.query(name,showinfo,);
}
function showinfo(flag){
if(flag){
${"errors1"}.style.visibility = "visible";
}else{
${"errors1"}.style.visibility = "hidden";}
}
</script>
</head>
<body onload="init()">
<form action="login.do" method="get">
<table>
<tr>
<td>姓名:</td>
<td><input type="text" id="name" name="title" onblur="validate()" > </td>
<td id="errors1"><font color="red">该用户存在</font> </td> </tr>
<tr>
为什么页面运行的时候“该用户存在”这句话是显示的?我已经写了隐藏效果了啊
------解决方案--------------------偶没见过${"errors1"}.style.visibility = "hidden";这样的
document.getElementById('').style.display = 'none' 试试呢
------解决方案--------------------3楼正解