title: Javascript if / else statement not working as expected
body: <p>working with CKEDITOR and trying to disable the submit button if the length of the content is 0, but then on keyup, check the function again and see if the value is more than 1 and if so set the submit button to enabled.</p>
  
  <p>So here we have this:</p>
  
  <pre><code>CKEDITOR.on('instanceReady', function(){
      disableNewPost();
      var e = CKEDITOR.instances['newpost'];
      e.on( 'keyup', function() {
          disableNewPost();
      });
  });
  
  function disableNewPost() {
      var value = CKEDITOR.instances['newpost'].getData();
      var valueL = value.length
      if ($(valueL) &lt; 1) {
          $(".addnewpostbtn").prop("disabled", true);
      } else if ($(valueL) &gt; 0) {
          $(".addnewpostbtn").prop("disabled", false);
      }
  }
  </code></pre>
  
  <p>This gets the value and length correctly, and if put an alert(value) or alert(valueL) it displays what it shoudld.</p>
  
  <p>However the if statement doesnt seem to work.</p>
  
  <p>Onpage load, the CKEDITOR has no content, and an alert shows its length as 0.</p>
  
  <p>However using the above if statement it doesnt disable the button. I have tried all variations i can think of ( == '' / == 0 ) etc. But no luck.</p>
  
  <p>If the function just contains:</p>
  
  <pre><code>$(".addnewpostbtn").prop("disabled", true);
  </code></pre>
  
  <p>Then it does disable.</p>
  
  <p>Any help?</p>