How to check if a line inside contenteditable div is empty
<p>How can I change this code so it detects whether a line inside c<strong>ontenteditable div</strong> is empty of has text? </p>

<pre><code>$('#area').on("keyup change", function() {
    if( this.value.substr(0,this.selectionStart).match(/(?:^|\s+)$/)
     &amp;&amp; this.value.substr(this.selectionStart).match(/^(?:\s+|$)/)) {
        console.log("empty");
    } else {
        console.log("has stuff");
    }
});
</code></pre>

<p>works the way it should with textarea. I tried to replace VALUE with innerHTML - alas! with no luck.</p>

<p><a href="http://jsfiddle.net/5uZjV/1/" rel="nofollow noreferrer">http://jsfiddle.net/5uZjV/1/</a></p>

<p>UPDATE: what I am looking for is <strong>to find out if A SEPARATE LINE is empty</strong>. For example - try to add several lines and then delete any line using backspace. Deleting one symbol by one - when there are no more symbols on the line - script should return "empty". Example:</p>

<ol>
<li>line number one text // on "Del"/"Backspace" keyup returns "has stuff"</li>
<li>// on "Del"/"Backspace" keyup returns "empty"</li>
<li>line number three text // on "Del"/"Backspace" keyup returns "has stuff"</li>
</ol>