I have one page, with two textarea
elements. How do I copy the text from one textarea
to another?
<textarea id="one"></textarea>
<textarea id="two"></textarea>
So text area one is primarily where the data appears, I need to copy it to text area two during the onchange event.
This is how I would do it:
$("#one, #two").on("change keyup", function(){
$("textarea").not($(this)).val($(this).val());
});
The code will synchronize both textareas