REMOVING DOM ELEMENTS USING JQUERY.

Ankit Singh

Total Post:341

Points:2389
Posted by  Ankit Singh
JQuery 
 476  View(s)
Ratings:
Rate this:
How to Removing DOM Elements Using Jquery. Please Help me.
  1. aditya kumar Patel

    Post:254

    Points:1810
    Re: Removing DOM Elements Using Jquery.

      the method remove( expr ) method removes all matched elements from the DOM.

    <!DOCTYPE html>

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>

    <title>The jQuery Example</title>

    <script type = "text/javascript"

    src = "http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

    <script type = "text/javascript" language = "javascript">

    $(document).ready(function () {

    $("p").click(function () {

    $(this).remove();

    });

    });

    </script>

    <style>

    .div{ margin:10px;padding:12px; border:2px solid #666; width:70px;}

    </style>

    </head>

    <body>

    <p class = "div" style = "background-color:green;">Hello</p>

    <p class = "div" style = "background-color:yellow;">Hi</p>

    <p class = "div" style = "background-color:red;">Call Back</p>

    </body>

    </html>

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!