title: Preventing blank input not working
body: <p>I'm trying to prevent blank input on an editable list item, I'm using the same code I use somewhere else but for some reason it is not working.</p>
  
  <p>I have:</p>
  
  <pre><code>if(folderName == "" || folderName == " " || folderName.charAt(0) == " "){
          $(this).remove();
      }
  </code></pre>
  
  <p>It is removing the item if I do not type anything, though if I enter a blank space it doesn't call the remove.</p>
  
  <p>Strange thing is I am using this exact same code in a different area and it's working fine.</p>
  
  <p>Here is the full function:</p>
  
  <pre><code>$(document).on('focusout', '#folders li', function(){ //add class when lose focus/shorten name if too long
      var folderName = $(this).text();
      $('#folders li').removeAttr('contenteditable');
      $('#folders li').removeClass('active-tab');
      $(this).addClass('active-tab');
      if(folderName.length &gt; 15){
          $(this).attr('title', $(this).text());
          shortFolderName=folderName.substring(0,15) + '...';
          $(this).text(shortFolderName);
      }
      else if(folderName.length &lt;= 15){
          $(this).text(folderName);
          $(this).attr('title', $(this).text());
      }
      if(folderName == "" || folderName == " " || folderName.charAt(0) == " "){
          $(this).remove();
      }
      console.log(folderName);
  })
  </code></pre>
  
  <p>html:</p>
  
  <pre><code>&lt;div id="tabs"&gt;
      &lt;ul id="folders"&gt;
          &lt;li class="active-tab" &gt;All Notes&lt;/li&gt;
          &lt;li&gt;Work&lt;/li&gt;
          &lt;li&gt;Personal&lt;/li&gt;
          &lt;li id="add" class="glyphicon glyphicon-plus"&gt;&lt;/li&gt;
      &lt;ul&gt;
  &lt;/div&gt;
  </code></pre>