简体   繁体   中英

how to add check box in “select 2 dropdown”

hello all i am new to page designing please help me with this current query

<body>
    <select id="companyName" class="form-control__" style="width:100%;height: 34px;" onchange="" tabindex="4">
        <option value="">Select </option>
    </select>
</body>

<script>
    $(document).ready(function () {
        $('#companyName').select2('close');
    });
</script>

Try to use this plugin https://github.com/wasikuss/select2-multi-checkboxes

Example:

$('#companyName').select2MultiCheckboxes({
    placeholder: "Choose multiple elements",
})

http://jsfiddle.net/wasikuss/gx93rwnk/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM