PHP群:95885625 Hbuilder+MUI群:81989597 站长QQ:634381967
    您现在的位置: 首页 > 开发编程 > Jquery教程 > 正文

    jQuery删除HTML元素的方法

    作者:admin来源:B5教程网浏览:时间:2020-09-30 00:07:50我要评论
    导读:jQuery删除HTML元素的方法只需要用到remove()就可以,具体的看以下例子。<!DOCTYPE html><html><head><meta http-equiv="content-type" ...
     
    jQuery删除HTML元素的方法只需要用到
    remove()就可以,具体的看以下例子。
    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <title>B5教程网</title>
    <script type="text/javascript" src="http://www.bcty365.com/statics/js/bcty365_js/jquery.min.js"></script>
    <script>
    $(document).ready(function(){
      $("button").click(function(){
        $("#phpboys").remove();
      });
    });
    </script>
    </head>
    <body>
    <div id="phpboys">
    jQuery删除html元素的方法
    <p>www.bcty365.com</p>
    </div>
    <button>删除 div 元素</button>
    </body>
    </html>
     

    转载请注明(B5教程网)原文链接:https://b5.mxunkeji.com/content-47-359-1.html
    相关热词搜索: remove 删除