Bootstrap multiselect multi-choice function implementation method, bootstrapselect multi-Choice
Official tutorial
Http://www.kuitao8.com/demo/20140224/1/bootstrap-multiselect-master/index.html
Usage:
Step 1 reference styles and related JS
<link rel="stylesheet" href="css/bootstrap.min.css" rel="external nofollow" type="text/css"/><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/bootstrap.min.js"></script> <!-- Include the plugin's CSS and JS: --><script type="text/javascript" src="js/bootstrap-multiselect.js"></script><link rel="stylesheet" href="css/bootstrap-multiselect.css" rel="external nofollow" type="text/css"/>
Step 2 construct Selection (note that you need to set the multiple attribute; otherwise, it will still be in single-choice mode, multiple = "multiple ")
<!-- Build your select: --><select class="multiselect" multiple="multiple"> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> <option value="pepperoni">Pepperoni</option> <option value="onions">Onions</option></select>
Step 3 initialize the plug-in:
<script type="text/javascript"> $(document).ready(function() { $('.multiselect').multiselect(); });</script>
Common Methods:
Select $ ('# cid'). multiselect ('select', arr [I]); set the selected items for the control
Get value
$ ('# Cid'). val (); obtain all the selected values of the control.
The above section describes how to implement the bootstrap multiselect multi-choice function. I hope it will help you. If you have any questions, please leave a message and I will reply to you in a timely manner. Thank you very much for your support for the help House website!