在html中如何使一个button或text控件不可见?
<INPUT type="button" value="Button" id=button1 name=button1 disabled>
<INPUT type="text" id=text1 name=text1 readonly>
<INPUT type="hidden" value="Button" id=button1 name=button1 >
<INPUT type="text" id=text1 name=text1 style="visibility:hidden">
<INPUT type="button" value="Button" id=button1 name=button1 style="visibility:hidden">
可以在jsp中做如下控制:
<INPUT TYPE="button" NAME="xzdq" value="<<" onClick="selectDept()" >
<script language="javascript">
if('<%=userId%>'!= null)document.all.xzdq.style.visibility="hidden";
</script>
或者:
<INPUT TYPE="button" NAME="xzdq" value="<<" onClick="selectDept()" >
<%
if(userId != null)
{
%>
<script language="javascript">
document.all.xzdq.style.visibility="hidden";
</script>
<%
}
%>
或者:
<INPUT TYPE="button" NAME="xzdq" value="<<" onClick="selectDept()" >
<%
if(userId != null)
out.println("<script language=\"javascript\"> document.all.xzdq.style.visibility=\"hidden\";</script>");
%>