title: Call jQuery UI Datepicker from another function
body: <p>The following is my code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(function(){ //this is the datepicker function
      $( "#datepicker" ).datepicker();
  });
  
  function jsFunction(){
     // i want to call the datepicker function from here
  }
  &lt;/script&gt;
  &lt;/head&gt;
  </code></pre>
  
  <p>html</p>
  
  <pre><code>&lt;html:image alt="Calendar" src="/images/icon_calendar.gif" 
      value="reset" onclick="jsFunction();" /&gt;
  &lt;input type="text" id="datepicker" /&gt;
  </code></pre>
  
  <p>When I click on the text box, the text box will prompt a calendar to let me choose the date. This date picker is working fine.</p>
  
  <p>I added in an image, and I want the text box to prompt the calendar when I click on the image instead of click on the text box. I would like to ask how to call the datepicker jquery from the onlick=jsFunction(); .</p>
  
  <p>I an working in Java Struts2 framework.</p>
  
  <p>Kindly advise/ help.</p>