title: jquery if else doesnt give back an alert message
body: <p>everything is writen in an external javascript file what I included in the html I also have the jquery link in there.</p>
  
  <p>I tried to change put the if statment on diffrent positions in the code, I looked arround if the width was incorrect and some other things whitch are inrelevent at the moment.</p>
  
  <p>When I changed the $foodcheck).width > '0px' to a &lt; and the else if to a > the alert did work but ofc I only want it to pop up if the width = 0</p>
  
  <p>I want it to give back the alert message.</p>
  
  <pre><code>var $foodcheck = $('#greenfood');
  if(($foodcheck).width &gt; '0px') {
  
      document.getElementById("f").onclick = function(){
  
          var random = Math.random();
  
          if(random &gt; 0.0 &amp;&amp; random &lt;= 0.5) {
  
              $("#greenfood").animate({width: "-=30px"});
  
          } else if(random &gt; 0.9) {
  
              $("#greenfood").animate({width: "-=80px"});
  
          } else {
  
              $("#greenfood").animate({width: "140px"});
  
          }
      };
   } else if(($foodcheck).width =&lt; '0px'){
          alert("Works");
      }
  </code></pre>