码迷,mamicode.com
首页 > 其他好文 > 详细

实现h5中radio单击取消与选中

时间:2018-01-25 16:50:38      阅读:2044      评论:0      收藏:0      [点我收藏+]

标签:fun   class   stat   body   input   function   document   log   cti   

        <input type = "radio" id = "raid" name = "raname" checked = ‘checked‘ onclick="radioclick();">111</input>
        <script>
            var radiostate = 1;
            function radioclick(){
                if (radiostate == 1){
                    document.getElementById(‘raid‘).checked = false;
                    radiostate = 0;
                }else{
                    document.getElementById(‘raid‘).checked = true;
                    radiostate = 1;
                }        
            }
        </script>   

实现h5中radio单击取消与选中

标签:fun   class   stat   body   input   function   document   log   cti   

原文地址:https://www.cnblogs.com/teamemory/p/8351744.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!