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>

你可能感兴趣的:(checkbox)