title: jQuery toggle() function not working
body: <p>This question may be asked before. But I cant find the error. Here this is from the video tutorial of new boston. </p>
  
  <pre><code>$(document).ready(function(){
  $('#btn').toggle(function(){
      $('#msg').html('yes');
  },function(){
      $('#msg').html('No');
  });
  });
  </code></pre>
  
  <p>The video showing that when click first the div text is <strong>yes</strong> and next time it show <strong>no</strong>
  But when I try, when the page loads, the button fadeout and div show <strong>no</strong>. Why? There may be other methods to achieve this functionality. But why this dont work. He showing the syntax of toggle as</p>
  
  <pre><code>$('#btn').toggle(function(){code},function{code});
  </code></pre>