<!DOCTYPE HTML>
<html>
<head>
<title>example</title>
</head>
<body>
<textarea style="width: 300px; height: 150px;">text1
text2
text3</textarea><br/>
<input type="button" value="click me">
<script>
var textarea = document.querySelector('textarea'),
button = document.querySelector('input');
button.onclick = function ()
{
var myList = textarea.value.split('\n');
for (var i = 0, ln = myList.length; i < ln; ++i)
alert(myList[i]);
}
</script>
</body>
</html>