Jquery Switchery checkbox disable created new checkbox on page

╄→尐↘猪︶ㄣ 提交于 2021-01-07 01:42:12

问题


i struggle to disable the Switchery checkbox but it creates me another Switchery checkbox on page . i first define the checkbox which is working great:

<div class="form-group">
    <label class="col-md-2">
        Additional Options
    </label>
    <div class="col-md-3">
        <div class="">
            <label>
                <input type="checkbox" id="foo1"
                       name="foo1" class="js-switch"/>
            </label>
        </div>
    </div>
</div>

now after the page loaded, i dynamically want to disable the checkbox so I do :

var foo1=  document.getElementById('foo1')
var switchery = new Switchery(foo1);
switchery.disable();

it disable the checkbox BUT it creates me new checkbox near the one i defined already i don't understand why

来源:https://stackoverflow.com/questions/65395449/jquery-switchery-checkbox-disable-created-new-checkbox-on-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!