save into array the content of textarea
i have a question. i want to get user entered text from a textarea into an array. i wrote the following code but i am only getting the first line of text rather than geting all of them in array  . and array length always comes out to be one. how can i save elements in an array, with each line saved in separate element of array.

    <html>
    <body>
    
    <script>
    
    function doit()
    {
    	
    var containertext=document.getElementById("holder").value.split("\n");	
    for(var i=0;i< containertext.length;i++)
    
    	document.write(containertext[i]);
    }
    
    
    </script>
    <textarea id="holder" rows=10></textarea>
    <button onclick="doit()">doit</button>
    </body>
    </html>

thanks
save into array the content of textarea
===

i have a question. i want to get user entered text from a textarea into an array. i wrote the following code but i am only getting the first line of text rather than geting all of them in array  . and array length always comes out to be one. how can i save elements in an array, with each line saved in separate element of array.

    <html>
    <body>
    
    <script>
    
    function doit()
    {
    	
    var containertext=document.getElementById("holder").value.split("\n");	
    for(var i=0;i< containertext.length;i++)
    
    	document.write(containertext[i]);
    }
    
    
    </script>
    <textarea id="holder" rows=10></textarea>
    <button onclick="doit()">doit</button>
    </body>
    </html>

thanks