<script>
function Xerox(new_line) {
var src = document.getElementById("Source").value;
var res = document.getElementById("Receiver");
var myList = src.split(new_line || /\r?\n/);
res.value = myList.join("\r\n");
}
</script>
<body>
<textarea id=Source rows=12 cols=40>First line;
Line #2
End of text.</textarea><br />
<input type='button' value='click me' onclick='Xerox(/\r?\n/)' /><br />
<textarea id=Receiver rows=12 cols=40></textarea>
</body>