Question: This is code to perform the delete operation. The four images appear, but the alert box for delete operation is not appearing by giving the onload functionality. Please guide me...here is the code.

```
// script for deletedelete operation  

    $(document).ready(function(){

        $('a.delete').on('click',function(e){
            e.preventDefault();
            imageID = $(this).closest('.image')[0].id;
            alert('Now deleting "'+imageID+'"');
            $(this).closest('.image')
                .fadeTo(300,0,function(){
                    $(this)
                        .animate({width:0},200,function(){
                            $(this)
                                .remove();
                        });
                });
        });

    });

```

HTML

```
//four images being given with delete link

 <div id="container">
        <div class="image" id="image1" style="background-image:url(http://lorempixel.com/100/100/abstract);">
            <a href="#" class="delete">Delete</a>
        </div>
        <div class="image" id="image2" style="background-image:url(http://lorempixel.com/100/100/food);">
            <a href="#" class="delete">Delete</a>
        </div>
        <div class="image" id="image3" style="background-image:url(http://lorempixel.com/100/100/people);">
            <a href="#" class="delete">Delete</a>
        </div>
        <div class="image" id="image4" style="background-image:url(http://lorempixel.com/100/100/technics);">
            <a href="#" class="delete">Delete</a>
        </div>
    </div>

```

Answer: 
You can use jQuery's build in filter() function, and write a filter with the condition you described.

First, you should hide all the items with any price.

```
$(".price").parent().hide();

```

Then, you can filter all the items with in-range prices and show them:

```
$(".price").filter(function(){
    var $this = $(this);
    var value = $this.val();
    return (value >= minNumber && value <= maxNumber); // returns boolean - true will keep this item in the filtered collection

}).parent().show();

```
I would go by something like:

1. Get all the divs that have prices.
2. Iterate through all:
	1. Transform the strings (minus the pound symbol) to float numbers and compare with an IF statement if they are inside the provided range.
	2. If they are just go to the next (use continue maybe)
	3. Else (not in the range) add a class like *.hide* so it can be blended through css (or just use the blend function from jquery)