title: How to check if contenteditable div contain only spaces jquery
body: <p>I want to prevent users from submit posts that contain only spaces so i try something like trim but i failed.</p>
  
  <p>How can detect if contenteditable div contain only spaces?</p>
  
  <pre><code>if(text.replace(/\n/g, "") =="" || jQuery.trim(text) == 0) {
      var is_empty = 'true';
  }
  </code></pre>