How to Attach Behavior to Image Wrapped in an 'A Tag'
<p>I have an aspx file when rendered, wraps an image in an "a" tag, as shown in the following HTML:</p>

<pre><code>&lt;td align="right" valign="top" nowrap="true" style="padding-left: 5px;"&gt;
    &lt;a id="ctl00_PlaceHolderMain_peUserPrimaryPoc_checkNames" tabindex="6" title="Check Names"
        onclick="var arg=getUplevel ('ctl00_PlaceHolderMain_peUserPrimaryPoc');var ctx='ctl00_PlaceHolderMain_peUserPrimaryPoc'; EntityEditorSetWaitCursor(ctx);WebForm_DoCallback('ctl00$PlaceHolderMain$peUserPrimaryPoc',arg,EntityEditorHandleCheckNameResult,ctx,EntityEditorHandleCheckNameError,true);return false;"
        href="javascript:"&gt;
        &lt;img title="Check Names" src="/_layouts/images/checknames.gif" alt="Check Names"
             style="border-width: 0px;" /&gt;&lt;/a&gt;&amp;nbsp;&lt;a id="ctl00_PlaceHolderMain_peUserPrimaryPoc_browse"
             accesskey="B" tabindex="6" title="Active Directory Picker" onclick="__Dialog__ctl00_PlaceHolderMain_peUserPrimaryPoc(); return false;"
             href="javascript:"&gt;
        &lt;img title="Active Directory Picker" src="/_layouts/images/addressbook.gif" alt="Active Directory Picker"
             style="border-width: 0px;" /&gt;
    &lt;/a&gt;
&lt;/td&gt;
</code></pre>

<p>I need to add behavior where if a user clicks the image wrapped in the a tag <code>ctl00_PlaceHolderMain_peUserPrimaryPoc_browse</code>, the parent panel <code>PageBodyPanel</code> is hidden and another panel 'UpdateProgress1' is displayed
My various attempts included </p>

<pre><code>&lt;script language="JavaScript" type="text/javascript"&gt;
    $(document).ready(function () {
        //ShowProgress();
        var target = null;
        target = $('#&lt;%=peUserPrimaryPoc.ClientID %&gt; a ');      //get the link surrounding the image
        target.click(function () { ShowProgress(); });      //attach a behavior to link click
    }); 

    function ShowProgress() {
        $('#&lt;%=UpdateProgress1.ClientID %&gt;').show();
        $('#&lt;%=PageBodyPanel.ClientID %&gt;').hide();
    } 
&lt;/script&gt;
</code></pre>

<p>This along with other various attempts does not work. Can anyone point me in the right direction please? Thanks in advance,</p>

<p>Bengal</p>
