title: Execute a function before the onclick event
body: <p>I have an image </p>
  
  <pre><code>&lt;input type="image" onclick="javascript:form1.ACTION.value='Edit';
                               form1.cin.value='100104213';
                               form1.histSeq.value='85258';                          
                               form1.typeCd.value='BL';
                               form1.RMC_CONFLICT_STATUS.value='';                                 
                               form1.submit(); 
                               return false" 
   alt="Click to edit this record." 
   title="Edit Row" 
   src="/images/editImage.gif" name="editButton"&gt;
  </code></pre>
  
  <p>If you look closely I have some statements which is executed onClick of the image.</p>
  
  <p>Now during the onload I want to associate an event(can be onlick) which should be called before the statements.</p>
  
  <p>I tried with </p>
  
  <pre><code>$('#grid0').find('#'+(i+1)).find('input:image').on('click',function(){
                                          console.log('Test');    
                                              });
  </code></pre>
  
  <p>But this is called after the statements.</p>