title: boolean if and else statement to toggle button
body: <p>I am receiving a True/False statement called favIcon, that is responsible for a button state. This button toggles from "active to "disabled", and behaves similar to a "facebook like button": on page load, if favIcon is true it shows the button "Active".</p>
  
  <p>First thing I am trying to do is to console.log the favState condition with an If statement. Current attempt looks like this (<a href="https://stackoverflow.com/questions/15393935/boolean-in-an-if-statement">this</a> is my reference):</p>
  
  <pre><code>     var favIcon = true;
  
       function onload(){
         if(favIcon == true){
              console.log ("active");
         }
  
         else {
               console.log ("disabled"); 
         }}
  </code></pre>
  
  <p>I didn't manage to make it work, and once I have this response, it will allow me to go to the next step:</p>
  
  <p>if favIcon == true, button state is active</p>
  
  <p>if favIcon == false, button state is disabled </p>
  
  <p>Now the button goes from disabled to active (I managed to make something to work!) (used this for <a href="https://stackoverflow.com/questions/11432369/set-var-to-true-false-in-toggle-function">ref</a>)</p>
  
  <pre><code>     &lt;input id="button" type="button" value="disabled"&gt;
  
       &lt;script&gt;
               $('#button').click(function() {
               $(this).val('active');
           });
       &lt;/script&gt;
  </code></pre>
  
  <p>Hopefully I was clear enough. Thank you all.</p>