Removing blank lines from textarea with jQuery
<p>First, I've tried all possible solutions that I've found here or Google, but no one seems to work for me.</p>

<p>To be clear, I need to remove every empty lines from a text area. 
This is what I've done so far:</p>

<pre><code>&lt;textarea name="text" class="form-control" rows="14" id="text" placeholder="Here goes our query" &gt;&lt;/textarea&gt;


$(document).ready(function () {
    $('#text').focusout(function () {
        var text = $('#text').val();

        text.replace(/(\r\n|\n|\r)/gm,"");

        alert('done');
    });
});
</code></pre>

<p>I get successful alert on end, but those empty lines are still there. Is regexp correct ?
My knowledge for js is not that big, so I need help :(</p>