title: same function for two buttons in jQuery
body: <p>I have two buttons: <code>btnAdd</code> and <code>btnUpdate</code>. I have written a jquery function for button <code>btnUpdate</code> to validate some fields in the web page like:</p>
  
  <pre><code>$(function() {
  
    $('#&lt;%=btnUpdate.ClientID %&gt;').click(function() {
      code here
      });
  });
  </code></pre>
  
  <p>I want to do the same thing when <code>btnAdd</code> is clicked. So I have to write the same function again for btnAdd. Is there other way to avoid this?  </p>
  
  <p>(If I write one javascript function and call the same function in the button click event of both buttons, it's fine. But is there any way using jQuery?)</p>