搜索文档
首页
HTML/CSS
JavaScript
服务端开发
Java教程
移动端
数据库
当前位置:
首页
JavaScript
jQuery 教程
jQuery 操作方法
源代码
清空
点击运行
<!DOCTYPE html> <html> <title>jQuery - Remove :contains删除指定内容示例 - 基础教程(div.cn)</title> <head> <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $("p").remove(":contains('Hello')"); }); }); </script> </head> <body> <p>Hello</p> <p>how are</p> <p>you?</p> <button>在段落上调用remove(":contains('Hello')")</button> </body> </html>
运行结果