Toggle between borders of a image and remove borders of other existing images
<h1>Context</h1>

<p>I want to select only one image and remove borders of other existing images</p>

<p>Now many images can be selected like that:</p>

<p><img src="http://i.stack.imgur.com/hkA1s.png" alt="enter image description here"></p>

<p>I want help on select and deselecting single images.</p>

<h1>My code</h1>

<pre><code>function clickpick(item) {

    for ( var i = 5; i &lt; document.images.length; i++) {

        document.images[i].onclick = function() {

        if (this.style.borderWidth == '5px') {
            selectpic = '';
            $("#display-frame").find("*").css("border", "0");
        } else {
            this.style.border = '5px solid blue';
            selectpic = $(item).attr("url");
        }

    };
}
</code></pre>

<p>Images are auto generated</p>

<h1>Html</h1>

<pre><code>&lt;div class="mainpic"&gt;&lt;img src="';path+=file.filepath+'" class="uploader-thumb-img" style="width: 108px; height: 120px; top: 0px; left: 0px; "/&gt;&lt;/div&gt;
</code></pre>

<p>update:
i want to select the url of the image sorry forgot to mention that</p>
