The use of append
on $("#result")
will not append to the value of the textarea
like you may expect - for that you need to use the val()
function.
So instead, to overwrite all the contents of the textarea
, use:
$("#result").val($("#temp").val());
To append to the contents of the textarea
, use something similar to:
var $result = $("#result");
$result.val($result.val() + $("#temp").val());