I have an image that I want to execute a link with a javascript onClick event when the image is clicked.
The link is:
<a class="test" href="javascript:;" onclick="foo.add( 'name=name', 'quantity=1' );">
<img src="pic.png" alt="Click" /></a>
Jquery I am fiddling with
$('.test').click(function(){
onclick = $(this).attr('onclick');
$(this).attr('onclick','');
return false;
});
Not working...