How to send the id of the input when clicking on an image which is in this particular input
<p>I have 2 inputs and image in each input. When I
 click the image in the input I want to clear the text only in this input.
 How to to this?</p>

<p>Here is my function</p>

<pre><code>function deleteText (id)
{
 //here i should get txtNameFirm ot txtNameOwner

var element = document.getElementsById(id);
element.value=" ";
}
</code></pre>

<p>HTML</p>

<pre><code>&lt;div class="outer" &gt;
    &lt;input type="text" id = "txtNameOwner"  value="ENTER NAME OF OWNER"   /&gt; 
    &lt;img src="file:///C:/Users/gismo2/Dropbox/GISmoBusinessCatalogProject-Feb2013/IconResources/close_btn.png" onclick="deleteText('txtNameOwner')/&gt;
&lt;/div&gt;

&lt;div class="outer" &gt;
    &lt;input type="text" id = "txtNameFirm"  value="ENTER NAME OF FIRM"   /&gt; 
    &lt;img src="file:///C:/Users/gismo2/Dropbox/GISmoBusinessCatalogProject-Feb2013/IconResources/close_btn.png" onclick="deleteText('txtNameFirm')" /&gt;
&lt;/div&gt;
</code></pre>
