本文实例讲述了jQuery+ajax实现批量删除功能。分享给大家供大家参考,具体如下:
效果展示:
完整代码如下:
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> <title>Ding Jianlong Html</title> <link href="https://cdn.bootcss.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="external nofollow" rel="stylesheet"> <link href="https://cdn.bootcss.com/layer/2.4/skin/layer.min.css" rel="external nofollow" rel="stylesheet"> </head> <body> <div class="container"> <button class="btn btn-danger radius" onClick="batch_del()" style='margin:10px;'>批量删除</button> <table style="width: 500px;" class="table table-striped table-hover table-bordered"> <thead> <tr> <th scope='col' width="25"><input type="checkbox" value="" name="selectall"></th> <th scope='col' width="80">ID</th> <th scope='col' >标题</th> </tr> </thead> <tbody> <tr> <td><input type="checkbox" value="10001"></td> <td>10001</td> <td >标题1</td> </tr> <tr> <td><input type="checkbox" value="10002"></td> <td>10002</td> <td >标题2</td> </tr> <tr> <td><input type="checkbox" value="10003"></td> <td>10003</td> <td >标题3</td> </tr> <tr> <td><input type="checkbox" value="10004"></td> <td>10004</td> <td >标题4</td> </tr> <tr> <td><input type="checkbox" value="10005"></td> <td>10005</td> <td >标题5</td> </tr> </tbody> </table> </div> <script src="/UploadFiles/2021-04-02/jquery.min.js">感兴趣的朋友可以使用在线HTML/CSS/JavaScript代码运行工具:http://tools.jb51.net/code/HtmlJsRun测试上述代码运行效果。
更多关于jQuery相关内容可查看本站专题:《jquery中Ajax用法总结》、《jQuery扩展技巧总结》、《jQuery常用插件及用法总结》、《jQuery常见经典特效汇总》及《jquery选择器用法总结》
希望本文所述对大家jQuery程序设计有所帮助。
最新资源
- 银霞.1982-《结·SAYYESMYBOY》台湾复刻版[WAV+C
- 梁汉文1993-火热动感[引进版][WAV+CUE]
- 梁汉文2008-EDMONDHITS48[香港]3CD[WAV+CUE]
- 国风大师纯音系列《童丽-[渭城曲]》1CD[WAV分轨
- 国风大师纯音系列《许菱子《烧筝2》古筝曲集》1
- 王子异《1996 Part.2》[320K/MP3][18.29MB]
- 群星.1994-宝丽金最倾情3CD【宝丽金】【WAV+CUE
- 乐俊亨.2024-同泪【CharioticMusic】【FLAC分轨
- 何耀珊.2006-收获【华纳】【WAV+CUE】
- 梁汉文1994-壹精选[华星][WAV+CUE]