网络编程 发布日期:2025/11/9 浏览次数:1
本文实例为大家分享了jquery实现多选下拉列表展示的具体代码,供大家参考,具体内容如下
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
ul li{
list-style: none;
}
.hide{display: none}
.width150{
width: 150px;
}
.width150 input[type="text"]{
width: 100%;
height: 32px;
border: 1px solid #ccc;
border-radius: 4px;
padding-left: 12px;
}
.width150 ul{
width: 96%;
padding: 0 0 0 20px;
margin: 0;
border: 1px solid #ccc;
}
.width150 li{
padding: 5px;
}
.width150 li+li{
border-top: 1px solid #ccc;
}
</style>
</head>
<body>
<form id="form">
<div class="width150">
可多选年份:<input type="text" id="yearInput" placeholder="请选择年份" readonly>
<ul id="yearId" class="hide">
</ul>
</div>
</form>
</body>
<script type="text/javascript" src="/UploadFiles/2021-04-02/jquery.js">
效果图:
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。