title: What is the difference between "API" and "input" toggling of toggle button in bootstrap-toggle?
body: <p>In an example of <a href="http://www.bootstraptoggle.com/" rel="nofollow">Bootstrap toggle button</a> control, there are two examples of turning them on and off: by API and by input.</p>
  
  <p>Section "API vs Input":</p>
  
  <pre><code>&lt;input id="toggle-trigger" type="checkbox" data-toggle="toggle"&gt;
  &lt;button class="btn btn-success" onclick="toggleOn()"&gt;On by API&lt;/button&gt;
  &lt;button class="btn btn-danger" onclick="toggleOff()"&gt;Off by API&lt;/button&gt;
  &lt;button class="btn btn-success" onclick="toggleOnByInput()"&gt;On by Input&lt;/button&gt;
  &lt;button class="btn btn-danger" onclick="toggleOffByInput()"&gt;Off by Input&lt;/button&gt;
  &lt;script&gt;
    function toggleOn() {
      $('#toggle-trigger').bootstrapToggle('on')
    }
    function toggleOff() {
      $('#toggle-trigger').bootstrapToggle('off')  
    }
    function toggleOnByInput() {
      $('#toggle-trigger').prop('checked', true).change()
    }
    function toggleOffByInput() {
      $('#toggle-trigger').prop('checked', false).change()
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>As one can see, operating button by API means calling <code>bootstrapToogle()</code> function, while operating by input means calling <code>prop('checked', true).change()</code>.</p>
  
  <p>What is the difference between these two methods? Visually they do the same.</p>