51代码网ORACLEMYSQLSQL SERVER其它数据库java/jspasp/asp.netC/C++/VC++APP应用其它语言服务器应用
您现在的位置: 51代码网 >> asp.net >> 文章正文

如何判断checkbox选中的时候设置text的值为空

更新时间:2012-3-26:  来源:51代码网

<script>
function chkpo(){
    if (document.getElementById("bb").checked== true){
         document.getElementById("aa").length == 0;        
        }   
    }</script><input type="text" name="aa" id="aa" />
<input type="checkbox" name="bb" id="bb" onclick="chkpo();"/>
document.getElementById("aa").style.display='none';
想设置隐藏还是这样比较好。。<script>
function chkpo(){
  if (document.getElementById("bb").checked== true){
  document.getElementById("aa").value = ''  
  }  
  }

</script>

<input type="text" name="aa" id="aa" />
<input type="checkbox" name="bb" id="bb" onclick="chkpo();"/>
function chkpo(){
  if (document.getElementById("bb").checked== true){
document.getElementById("aa").length == 0;  
  }  
  }
这是要干什么啊? 这个length属性没有意义的啊

  • 上一篇文章:
  • 下一篇文章: 没有了
  • 赞助商链接
    推荐文章
  • 此栏目下没有推荐文章
  • {
    设为首页 | 加入收藏 | 友情链接 | 网站地图 | 联系站长 |