JavaScript中让一个HTML控件变不可用或不可见的语句怎么表示

来源:百度知道 编辑:UC知道 时间:2024/06/07 13:19:38
用Button1.disabled =true;行吗?

不行呀!!
document.form1.button1.style.disabled=true;
才可以噢!~试试看吧。

<input id="Button1" type="button" value="这是一个按钮"><br>
<input type=button onclick="Button1.style.display='none'" value="不可见">
<input type=button onclick="Button1.style.display=''" value="可见">
<input type=button onclick="Button1.disabled=true" value="不可用">
<input type=button onclick="Button1.disabled=false" value="可用">
<br><br>
<input type=button value="不可用" disabled>
<input type=button value="不可见" style="display='none'">

//点击隐藏<input type=button onclick="this.style.display='none'">
//不可以修改<input type=button disabled>

//用javascript

<script language="javascript">
function