title: Jquery html() inside conditional check
body: <p>these are extract of my code</p>
  <pre><code>&lt;button&gt;Hook It!&lt;/button&gt;
  </code></pre>
  <p>and a bit of <code>JQuery</code></p>
  <pre><code>$(&quot;ul li .tag_detail button&quot;).on('click', function() {
      console.log($(this).html());
      if ($(this).html() == 'Hook It!') {
          $(this).html('Unhook!');
      }
      if ($(this).html() == 'Unhook!') {
          $(this).html('Hook It!');
      }
  });
  </code></pre>
  <p>Now, as you can see i want a toggling effect, i.e. when i click on button it should toggle between Hook It! and Unhook!.</p>
  <p>The problem lies here</p>
  <pre><code>if($(this).html() == 'Hook It!')
  </code></pre>
  <p>here this condition never passes while console log prints Hook It!</p>
  <pre><code>console.log($(this).html());
  </code></pre>