title: jQuery UI Datepicker - Custom button - Custom text
body: <p>I need to add a custom button in jQuery UI Datepicker, and when the user clicks that button, set a value to input (a string of text) and close the popup. Is possible this?</p>
  
  <p>Fiddle example: <a href="http://jsfiddle.net/7Wygg/" rel="nofollow">http://jsfiddle.net/7Wygg/</a></p>
  
  <pre><code>showButtonPanel: true,
  beforeShow: function (input) {
      setTimeout(function () {
          var buttonPane = $(input)
              .datepicker("widget")
              .find(".ui-datepicker-buttonpane");
  
          var btn = $('&lt;button class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" type="button"&gt;Custom&lt;/button&gt;');
          btn.unbind("click")
          .bind("click", function () {
              //$.datepicker._clearDate(input);
              alert('custom text');
          });
  
          btn.appendTo(buttonPane);
  
      }, 1);
  }
  </code></pre>
  
  <p>Thank you.</p>