Home > DeveloperSection > Forums > Removing DOM Elements Using Jquery.
Ankit Singh

Total Post:341

Points:2389
Posted on    March-27-2016 11:55 PM

 JQuery JQuery 
Ratings:


 1 Reply(s)
 213  View(s)
Rate this:
How to Removing DOM Elements Using Jquery. Please Help me.


aditya kumar Patel

Total Post:250

Points:1782
Posted on    March-28-2016 12:00 AM

  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>


Don't want to miss updates? Please click the below button!

Follow MindStick