title: clear textbox value using jquery
body: <p>I have used "<a href="http://tarruda.github.io/bootstrap-datetimepicker/" rel="nofollow">bootstrap-datetimepicke</a>" and I have an issue while clearing textbox using jQuery.</p>
  
  <p>my html code is:</p>
  
  <pre><code>&lt;div class="input-group datetimepicker4"&gt;
      &lt;input id="from" name="from" value="&lt;?php echo $from ?&gt;" placeholder="from" data-format="yyyy-MM-dd" readonly="readonly" type="text" style="background-color: #fff"&gt;
      &lt;span class="input-group-addon add-on"&gt;
          &lt;i data-time-icon="icon-time" data-date-icon="icon-calendar" class="icon-calendar"&gt;&lt;/i&gt;
      &lt;/span&gt;
  &lt;/div&gt;
  &lt;button class="btn btn-default" type="reset" name="reset"&gt;Reset&lt;/button&gt;
  </code></pre>
  
  <p>using the following code I try to reset the textbox value:</p>
  
  <pre><code>$(function() {
      $('.datetimepicker4').datetimepicker({
          pickTime: false,
          maskInput: true,
      });
  });
  
  
  $(document).ready(function () {
      $('button[type="reset"]').click(function () {
          $('#from').val('');     
          console.log($('#from').val());
      });
  });
  </code></pre>
  
  <p>After pressing the button and checking the console it shows an empty value which is correct while the textbox value keeps the old value (value of the input is filled up by script but users should be able to reset the value while reset button is clicked).</p>
  
  <p>I changed the button type from "reset" to "button" and now another issue came up!</p>
  
  <pre><code>$(document).ready(function () {
      $('button[type="button"]').click(function () {
          $('#from').val('');     
          console.log($('#from').val());
      });
  });
  </code></pre>
  
  <p>When the button is clicked its value is not shown anymore while opening inspecting elements window shows the old value which brings about posting the same value after submitting the form. </p>