jQuery .remove() Examples

Welcome To jQuery !!
+_+
Example 1
View
Click The Dogs !!

Source
<style type="text/css">
    .css_test img {
        cursor:pointer;
    }
</style>

Click The Dogs !!<br><br>

<div class="css_test">
    <img src="http://superkts.com/img/css/dog060.gif" onclick="$(this).remove()" />
    <img src="http://superkts.com/img/css/dog061.gif" onclick="$(this).remove()" />
    <img src="http://superkts.com/img/css/dog021.gif" onclick="$(this).remove()" />
    <img src="http://superkts.com/img/css/dog061.gif" onclick="$(this).remove()" />
    <img src="http://superkts.com/img/css/dog061.gif" onclick="$(this).remove()" />
</div>
jQuery

$( selector ).remove()

Example 2
With animate method
View
Click The Dogs !!

Source
<style type="text/css">
    .css_test img {
        cursor:pointer;
        position:relative;
    }
</style>

Click The Dogs !!<br><br>

<div class="css_test">
    <img src="http://superkts.com/img/css/dog060.gif" onclick="j_test(this)" />
    <img src="http://superkts.com/img/css/dog061.gif" onclick="j_test(this)" />
    <img src="http://superkts.com/img/css/dog021.gif" onclick="j_test(this)" />
    <img src="http://superkts.com/img/css/dog061.gif" onclick="j_test(this)" />
    <img src="http://superkts.com/img/css/dog061.gif" onclick="j_test(this)" />
</div>

<script type="text/javascript">
    function j_test(o){
        $(o).animate( { top:'-=200', opacity:0 }, 200, function(){
            $(this).remove();
        });
    }
</script>
Example 3
Use Filtering
View
Click The Dogs !!



Source
Click The Dogs !!<br><br>
<button type="button" onclick="$('.css_test img').remove('[src*=021]')">Black Dog Out</button><br><br>

<div class="css_test">
    <img src="http://superkts.com/img/css/dog021.gif" />
    <img src="http://superkts.com/img/css/dog061.gif" />
    <img src="http://superkts.com/img/css/dog021.gif" />
    <img src="http://superkts.com/img/css/dog061.gif" />
    <img src="http://superkts.com/img/css/dog061.gif" />
</div>
jQuery

$( selector ).remove( filter )

jQuery .remove() Documentation : http://api.jquery.com/remove/