js 清空所有checkbox

    <script language ="javascript" type="text/javascript">
        function clearText()
        {
              var txts=document.getElementsByTagName("input");
            for(var i=0;i <txts.length;i++)
            {
                if(txts[i].type=="checkbox" || txts[i].type=="text")
                {
                    txts[i].value ="";
                }
            }
        }
    </script>
posted @ 2009-08-27 10:03  艾伦  阅读(2079)  评论(1编辑  收藏  举报