Jquery can be used to implement a multi selection drop down box

  • 2020-03-30 02:04:32
  • OfStack

First download the jquery. Multiselect.js plug-in and then copy the following code, just change the path to achieve the multi-selection drop-down box. If it is good, please support!

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
body {
 margin-left: 5px;
 margin-top: 5px;
 margin-right: 5px;
 margin-bottom: 5px;
}
-->
</style>
<script type="text/javascript" src="jquery.js"></script>
<link rel="stylesheet" type="text/css" href="jquery-ui.css" />
<script type="text/javascript" src="jquery-ui.min.js"></script>
<script type="text/javascript" src="jquery.multiselect.js"></script>
<link rel="stylesheet" type="text/css" href="jquery.multiselect.css" />
<script type="text/javascript">
$(function(){
 $("#company").multiselect();

});
</script>
</head>
<body>
<table align="center">
   <tr>
              <td height="49"><select name="company" id="company">
                <option value=" The company " selected="selected"> North company [head office] </option>
                <option value=" Southwest company "> Southwest company </option>
              </select><span id="company1" style="color:#FF0000"></span></td>
              <td align="left"> </td>
            </tr>
</table>
</body>
</html>

Related articles: