How can I simulate a javascript onClick event through a href link for mobile users
<p>I have an html page where I use javascript to change the image a user sees when he/she clicks on it.  An example of one of the links is below.</p>

<pre><code>&lt;img alt="Click" height="400" name="smile" onmousedown="document.images['smile'].src='http://foobar.com/image2.jpg'" onmouseup="document.images['smile'].src='http://foobar.com/image1.jpg'" src="http://foobar.com/image1.jpg" width="400" /&gt;
</code></pre>

<p>The problem is this doesn't work for mobile browser users.  I tried simulating a click on this image with the following:</p>

<pre><code>&lt;a href="JavaScript:document.images['smile'].click()"&gt;click here&lt;/a&gt;
</code></pre>

<p>This doesn't work on any browser I tried, let alone a mobile one.</p>

<ol>
<li>Is there something fundementally wrong with what I'm doing?</li>
<li>Is there an alternative way to do what I'm trying?</li>
</ol>

<p>Thank you.</p>
