title: How to get jQuery event handler return value
body: <p>I have a link with <code>id="something"</code>:</p>
  
  <p><strong>html</strong></p>
  
  <pre><code>&lt;a id="something" onclick="getReturnValue()"&gt; Something &lt;/a&gt;
  </code></pre>
  
  <p><strong>javascript</strong></p>
  
  <pre><code>function getReturnValue(){
    //some validation
    if(validation fails){
      return false;
    }else{
      return true;
    }
  }
  </code></pre>
  
  <p>I need to get the return value when I use:</p>
  
  <pre><code>$("#something").click();
  </code></pre>
  
  <p>How can I get the return value for the event ?</p>
  
  <p>Already onclick function is mentioned in the html  tag. I wanted to use:</p>
  
  <pre><code>$("#something").click(); 
  </code></pre>
  
  <p>and from that I wanted to get return value. </p>
  
  <p>As I have to use it in multiple place, I dont want to write <code>getReturnValue()</code> method again and again like:</p>
  
  <pre><code>click(function(){ getReturnValue() })
  </code></pre>
  
  <p>I need to do this</p>
  
  <pre><code>if($("#something").click() == true){
    form.submit();
  }
  </code></pre>
  
  <p>click() will call getReturnValue() which will do some validation. If the validation fails, it return false and I need not submit the form. If validation is true, I need to submit the form</p>