Can I use jQuery or javascript to make an <Img> behave like a link without the <a> based on class?
<p>I have a large number of images of the same class "linkImg" and I would like them to behave as links without adding  tags.</p>

<p>What I'm tryng is something like this:</p>

<pre><code>&lt;script type="text/javascript"&gt;

$(function()
    {
        $('.linkImg').click( function( event )
            {
            var fileSrc = $(this).attr('src');
            fileSrc = fileSrc.slice(fileSrc.lastIndexOf('/')+1,-4); // gets the image file name   
                var linkPath = '_img/largeImg/' + fileSrc + '.jpg';
            var linkRel = 'relValue';
            var linkTarget ='targetValue';
            gotothelinl(linkPath, linkRel, linkTarget)// this is just a made-up function - it the part I don't know how to make work


            })
    } );

&lt;/script&gt;
</code></pre>

<p>When it works it should behave like the tag was there with all attribute intact. I tried using location.href but I can't ad rel or target attributes to that.</p>

<p>thx in advance</p>

<p>David</p>
