jQuery select and unselect image
<p>i have image set div tag like below</p>

<pre><code>&lt;div style="width: 600px; background: #CCC;padding: 50px;" class="jjj"&gt;
&lt;img src="http://www.nasa.gov/images/content/297522main_image_1244_946-710.jpg" class="ddd"  width="200"/&gt;
&lt;img src="http://www.nasa.gov/images/content/297522main_image_1244_946-710.jpg" class="ddd"  width="200"/&gt;
&lt;img src="http://www.nasa.gov/images/content/297522main_image_1244_946-710.jpg" class="ddd"  width="200"/&gt;
&lt;/div&gt;
</code></pre>

<p>My CSS is</p>

<pre><code>&lt;style&gt;
.ddd:hover{
            transform: scale(1.2);
-ms-transform: scale(1.2); /* IE 9 */
-webkit-transform: scale(1.2); /* Safari and Chrome */
-o-transform: scale(1.2); /* Opera */
-moz-transform: scale(1.2); /* Firefox */
        }

        .selectedd{
            transform: scale(1.2);
-ms-transform: scale(1.2); /* IE 9 */
-webkit-transform: scale(1.2); /* Safari and Chrome */
-o-transform: scale(1.2); /* Opera */
-moz-transform: scale(1.2); /* Firefox */
border:2px inset silver;
        }
&lt;/style&gt;
</code></pre>

<p>i need to select image when user click on it (change the class), i added the script for this and it working, but how can i deselect this image when user clicks on out side, i mean on div tag.
my jQuery</p>

<pre><code>&lt;script&gt;
$(function(){
    $('.ddd').click(function(){
        ff=this;
        $('.ddd').removeClass('selectedd')
        $(ff).addClass('selectedd')
    }); 
    });
&lt;/script&gt;
</code></pre>

<p>Please help me.
thank you</p>
