Javascript how to split newline
<p>I'm use jquery, and I have a textarea, so when I submit button I will alert every text separate by newline. How to split from newline?</p>

<pre><code>  var ks = $('#keywords').val().split("\n");
  (function($){
     $(document).ready(function(){
        $('#data').submit(function(e){
           e.preventDefault();
           alert(ks[0]);
           $.each(ks, function(k){
              alert(k);
           });
        });
     });
  })(jQuery);
</code></pre>

<p>example input :</p>

<pre><code>Hello
There
</code></pre>

<p>Result I want is :</p>

<pre><code>alert(Hello); and
alert(There)
</code></pre>
