title: Doing the same function with Multiple click events in jquery
body: <pre><code>$(document).on('click','#closeNewProductExpand', function() {
  
          $('#newProductExpand').css('width', '0');
      });
  
      $(document).on('click', '#searchProduct', function() {
  
          $('#newProductExpand').css('width', '0');
      });
  
      $(document).on('click', '#productsData', function() {
  
          $('#newProductExpand').css('width', '0');
      });
  </code></pre>
  <p>Here I want to set the width to 0 of #newProductExpand if one of the above 3 buttons is clicked.Is there any way to write this code rather than wasting such a larger space.I appreciate your help.Thanks</p>