jquery输入框动态查询l<li></li>列表

1、html代码如下:

2、js代码如下:

$('#search').bind('input propertychange', function () {
    searchKpoint();
});

function searchKpoint() {
    var searchName = $("#search").val();
    if (searchName == "") {
        $(".weaklist .kpoint li").show();
    } else {
        $(".weaklist .kpoint li").each(
            function () {
                var Kname = $(this).attr("Kname");
                if (Kname.indexOf(searchName) != -1) {
                    $(this).show();
                } else {
                    $(this).hide();
                }
            });
    }
}
View Code

 

转载于:https://www.cnblogs.com/robert-s/p/9441628.html

<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> <link rel="stylesheet" type="text/css" href="css/bootstrap.css" /> <link rel="stylesheet" type="text/css" href="css/bootstrap-icons.css" /> <link rel="stylesheet" href="css/style.css" /> <link rel="stylesheet" href="css/table.css" /> <style> .bg-f4f6f7 { background-color: #f4f6f7; } </style> </head> <body> <div> <div class="bg-primary d-flex justify-content-between align-items-center row p-3"> <div class="h1 text-white ml-5">&AElig;on</div> <div class="row mr-5"> <img src="img/管理员.png" class="gly mr-1" /> <div>管理员</div> </div> </div> <div class="row bg-f4f6f7"> <div class="sidebar"> <ul class="nav flex-column px-2 py-3"> <li class="nav-item"> <a class="nav-link " href="#" data-template="home"> 首页 </a> </li> <!-- 用户管理 --> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false"> 用户管理 </a> <ul class="dropdown-menu" aria-labelledby="userDropdown"> <li><a class="dropdown-item" href="#">封禁/解除用户</a></li> <li><a class="dropdown-item" href="#" data-template="users">用户列表</a></li> <li><a class="dropdown-item" href="#">用户行为记录</a></li> </ul> </li> <!-- 歌手管理 --> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" id="singerDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false"> 歌手管理 </a> <ul class="dropdown-menu" aria-labelledby="singerDropdown"> <li><a class="dropdown-item" href="#">封禁/解封歌手</a></li> <li><a class="dropdown-item" href="#" data-template="geshou">歌手歌曲</a></li> </ul> </li> <!-- 歌曲内容管理 --> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" id="songDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false"> 歌曲内容管理 </a> <ul class="dropdown-menu" aria-labelledby="songDropdown"> <li><a class="dropdown-item" href="#">歌曲收藏</a></li> <li><a class="dropdown-item" href="#">评论管理</a></li> <li><a class="dropdown-item" href="#">歌曲信息</a></li> <li><a class="dropdown-item" href="#" data-template="gedan">歌单管理</a></li> </ul> </li> <!-- 社区管理 --> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" id="communityDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false"> 社区管理 </a> <ul class="dropdown-menu" aria-labelledby="communityDropdown"> <li><a class="dropdown-item" href="#" data-template="shequ">帖子审核</a></li> <li><a class="dropdown-item" href="#">帖子发布</a></li> <li><a class="dropdown-item" href="#">举报处理</a></li> </ul> </li> <!-- 数据分析 --> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" id="analysisDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false"> 数据分析 </a> <ul class="dropdown-menu" aria-labelledby="analysisDropdown"> <li><a class="dropdown-item" href="#" data-template="data">播放量分析</a></li> <li><a class="dropdown-item" href="#">用户分析</a></li> </ul> </li> <!-- 管理员管理 --> <li class="nav-item"> <a class="nav-link" href="#" data-template="guanli"> 管理员管理 </a> </li> <!-- 系统管理 --> <li class="nav-item"> <a class="nav-link" href="#"> 系统管理 </a> </li> </ul> </div> <div class="m-2" id="contentArea"></div> </div> <template id="homeTpl" class=""> <div class="daohang"> <h5>首页</h5> </div> <div class="homet"> <div class="hometl"> <h6>用户数量</h6> <div class="yonghu mt-4"> <div>新增用户数<a>{{usernum}}</a></div> <div>总用户数<a>{{totalusernum}}</a></div> </div> </div> <div class="hometr"> <h6>歌手数量</h6> <div class="geshou mt-4"> <div>总歌手数<a>{{singernum}}</a></div> </div> </div> </div> <div class="homeb"> <div class="homebl"> <h6>代办事项</h6> <div class="daiban mt-4"> <div>无</div> </div> </div> <div class="homebr"> <div class="homebrt"> <h6>快捷入口</h6> <div class="d-flex justify-content-around mt-4"> <div class="kuaijie"> <img src="img/管理员.png" style="height: 40px;width: 40px;" /> <div>用户</div> </div> <div class="kuaijie"> <img src="img/管理员.png" style="height: 40px;width: 40px;" /> <div>用户</div> </div> <div class="kuaijie"> <img src="img/管理员.png" style="height: 40px;width: 40px;" /> <div>用户</div> </div> <div class="kuaijie"> <img src="img/管理员.png" style="height: 40px;width: 40px;" /> <div>用户</div> </div> <div class="kuaijie"> <img src="img/管理员.png" style="height: 40px;width: 40px;" /> <div>用户</div> </div> <div class="kuaijie"> <img src="img/管理员.png" style="height: 40px;width: 40px;" /> <div>用户</div> </div> <div class="kuaijie"> <img src="img/管理员.png" style="height: 40px;width: 40px;" /> <div>用户</div> </div> <div class="kuaijie"> <img src="img/管理员.png" style="height: 40px;width: 40px;" /> <div>用户</div> </div> </div> </div> <div class="homebrb"> <h6>访问统计</h6> </div> </div> </div> </template> <template id="usersTpl"> <div class="daohang"> <h5>首页->用户</h5> </div> <div class="user"> <div class="sousuo"> <div>用户名:</div> <input placeholder="查询内容" class="pt-2 pb-2 rounded" /> <div class="border border-secondary rounded p-2">查询</div> </div> <div class="zs"> <div class="border border-secondary rounded p-2">新增</div> <div class="border border-secondary rounded p-2">删除</div> </div> <table id="userTable" style="margin-top: 10px;"> <thead> <tr> <th>选择</th> <th>索引</th> <th>用户名</th> <th>头像</th> <th>性别</th> <th>账号</th> <th>操作</th> </tr> </thead> <tbody id="tableBody"> <!-- 数据将通过JavaScript动态加载 --> </tbody> </table> </div> </template> <template id="singerTpl"> <div class="daohang"> <h5>首页->歌手</h5> </div> <div class="singer"> <div class="sousuo"> <div>歌手/歌曲:</div> <input placeholder="查询内容" class="pt-2 pb-2 rounded" /> <div class="border border-secondary rounded p-2">查询</div> </div> <div class="zs"> <div class="border border-secondary rounded p-2">新增</div> <div class="border border-secondary rounded p-2">删除</div> </div> <table id="userTable" style="margin-top: 10px;"> <thead> <tr> <th><input type="checkbox" id="selectAll" class="checkbox"></th> <th>索引</th> <th>歌手</th> <th>照片</th> <th>性别</th> <th>歌曲</th> <th>操作</th> </tr> </thead> <tbody id="tableBody"> <tr> <td colspan="7" class="loading">加载中...</td> </tr> </tbody> </table> </div> </template> <template id="gedanTpl"> <div class="daohang"> <h5>首页->歌单</h5> </div> <div class="gedan"> <div class="sousuo"> <div>歌单:</div> <input placeholder="查询内容" class="pt-2 pb-2 rounded" /> <div class="border border-secondary rounded p-2">查询</div> </div> <div class="zs"> <div class="border border-secondary rounded p-2">新增</div> <div class="border border-secondary rounded p-2">删除</div> </div> <table id="musicTable" style="margin-top: 10px;"> <thead> <tr> <th>索引</th> <th>歌曲名称</th> <th>海报</th> <th>歌曲分类</th> <th>歌手</th> <th>视频</th> <th>操作</th> </tr> </thead> <tbody id="tableBody"> <tr> <td colspan="7" class="loading">加载中...</td> </tr> </tbody> </table> </div> </template> <template id="shequTpl"> <div class="daohang"> <h5>首页->社区</h5> </div> <div class="shequ"> <div class="sousuo"> <div>歌单:</div> <input placeholder="查询内容" class="pt-2 pb-2 rounded" /> <div class="border border-secondary rounded p-2">查询</div> </div> <div class="zs"> <div class="border border-secondary rounded p-2">新增</div> <div class="border border-secondary rounded p-2">删除</div> </div> <table id="shequTable" style="margin-top: 10px;"> <thead> <tr> <th><input type="checkbox" id="selectAll"></th> <th>编号</th> <th>帖子标题</th> <th>发布人</th> <th>发布时间</th> <th>更新时间</th> <th>审核时间</th> <th>状态</th> <th>操作</th> </tr> </thead> <tbody id="tableBody"> <tr> <td colspan="9" class="loading">加载中...</td> </tr> </tbody> </table> </div> </template> <template id="shujuTpl"> <div class="daohang"> <h5>播放量</h5> </div> <div class="shuju"> <div class="sjl"> <h6>平台总播放量分析</h6> </div> <div class="sjr"> <div class="sjrt"> 歌手播放量 </div> <div class="sjrb"> 当前趋势分析 </div> </div> </div> </template> <template id="guanliTpl"> <div class="daohang"> <h5>管理员管理</h5> </div> <div class="guanliyuan"> <div class="gll"> <h6>管理员</h6> </div> <div class="glr"> </div> </div> </template> </div> <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.js"></script> <script src="js/cebianlan.js"></script> <!-- <script src="js/shequ.js"></script> <script src="js/gedan.js"></script> <script src="js/geshou.js"></script> <script src="js/yonghu.js"></script> --> </body> </html>在js中新增20条用户数据,能够进行增删设置,搜索设置
06-14
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <title>Contact</title> <link rel="stylesheet" type="text/css" href="css/style_mobile.css"> <script language="javascript" type="text/javascript" src="js/jquery-1.9.1.min.js"></script> <script language="javascript" type="text/javascript" src="js/action.js"></script> </head> <body> <div id="container"> <div id="header"> <div id="logo">David Lanham</div> <ul> <li><a href="Index.html">Blog</a></li> <li><a href="Work.html">Work</a></li> <li><a href="About.html">About</a></li> <li><a class="active" href="Contact.html">Contact</a></li> </ul> </div> <div id="content"> <p class="content_text">Contact</p> <div id="from"> <tr><p class="font">Name<font color="#FF0000">*</font></p></tr> <tr><input class="input" type="text" name="name" id="name" ></tr> <tr> <p class="font">Email<font color="#FF0000">*</font></p></tr> <tr><input class="input" type="text" name="email" id="email"></tr> <tr> <p class="font">Message<font color="#FF0000">*</font></p></tr> <tr><textarea class="msginput" type="text" name="message" id="message"></textarea></tr> <tr><input class="button" type="button" value="SUBMIT" id="button"></tr> </div> </div> <div id="footer"> <div id="fttext"> <p>All illustrations on this site are from the very talented</p> <p> illustrator and designer David Lanham. Make sure to</p> <p>check out his work at <a href="#">DavidLanham.com.</a></p> </div> <div id="ftimage"> <a href="#"><img src="images/footer_baby.png"></a> </div> <div id="ft_text"> <p class="ftname">David Lanham</p> <p class="ftabout">I create beatufiul illustrations and designs.<a href="#">About me.</a></p> </div> <ul> <li><a href="#"><img src="images/footer_bird.png"></a></li> <li><a href="#"><img src="images/footer_ball.png"></a></li> <li><a href="#"><img src="images/footer_be.png"></a></li> <li><a href="#"><img src="images/footer_@.png"></a></li> <li><a href="#"><img src="images/footer_message.png"></a></li> </ul> </div> </div> </body> </html> 请检查上述前端html代码是否有问题,里面的提交按钮一直是灰色的,无法点击
最新发布
08-08
<!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>02</title> <link href="bootstrap.min.css" rel="stylesheet"> <style> .bg { overflow: hidden; background-color: beige; } </style> </head> <body> <section class="bg"> <div class="container col-sm-12"> <div class="col-sm-4 col-sm-offset-4" autocomplete="off"> <fieldset> <legend style="color: #0e0e0e">注 册</legend> <div class="form-group"> <label for="passwordField">Password</label> <input type="password" name="passwordField" id="passwordField" class="form-control" required='required'/> </div> </fieldset> <div> <button type="button" class="btn btn-primary btn-validate">验证</button> <span>   强度等级:</span> <span class="result">未验证</span> </div> </div> </div> <div class="container col-sm-12"> <br/> <div class="col-sm-12 col-sm-offset-4"> <p><strong>你填写的密码的强度等级按如下划分:</strong></p> <dl> <dt>低:</dt> <ol> <li>密码必须大于 8 个字符</li> </ol> <dt>中(在满足低强度要求的前提下,需要满足以下需求):</dt> <dd> <ol> <li>至少需要一个小写字母</li> <li>至少需要一个数字</li> </ol> </dd> <dt>高(在满足中强度要求的前提下,需要满足以下需求):</dt> <dd> <ol> <li>至少需要一个大写字母</li> <li>至少需要一个(除数字和字母外的)特殊字符</li> </ol> </dd> </dl> </div> </div> </section> <script src="jquery.min.js"></script> <script> </script> </body> </html> 请帮我补全代码
03-10
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值