<script> function copy_text(val) { document.getElementById("txt2").value = val; } </script> <textarea id="txt1" onkeyup="copy_text(this.value)"></textarea> <textarea id="txt2"></textarea>