我想制作一个月份列表下拉菜单,它将选择值而不是选项文本。我使用了 JQuery Multiselect.js,这是代码: 注意:CDN 链接在这里不起作用。但我的 lib 文件可以正常工作.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Multi-select Dropdown List with Checkbox by CodexWorld</title>
<link href="https://cdn.jsdelivr.net/jquery.multiselect/1.13/jquery.multiselect.css" rel="stylesheet" type="text/css">
<style>
body { font-family:'Open Sans' Arial, Helvetica, sans-serif}
ul,li { margin:0; padding:0; list-style:none;}
.label { color:#000; font-size:16px;}
</style>
</head>
<body>
<h2>jQuery MultiSelect Basic Uses</h2>
<select name="langOpt[]" multiple id="langOpt" >
<option value="All">All</option>
<option value="Jan">January</option>
<option value="Feb">February</option>
<option value="Mar">March</option>
<option value="Apr">April</option>
<option value="May">May</option>
<option value="Jun">June</option>
<option value="Jul">July</option>
<option value="Aug">August</option>
<option value="Sep">September</option>
<option value="Oct">October</option>
<option value="Nov">November</option>
<option value="Dec">December</option>
</select>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/jquery.multiselect/1.13/jquery.multiselect.js"></script>
<script>
$('#langOpt').multiselect({
placeholder: 'Select Months'
});
</script>
</body>
</html>
请帮忙谢谢。