Inserting a value into text area?

Inserting a value into text area?

Okay since I'm inserting the value into textarea, Here is the updated codes.

Here are the codes below,

  1. <script> var string_ans = '<?php echo $ans ?>; $(function () { $("div #right-answer").hide(); $("div #reference").hide(); $("#done").click(function(){ $("textarea #right-answer2").val(string_ans.val()); $("div #right-answer").show(); $("div #reference").show(); }); }); </script>


 It is not inserting the value into textarea?

What's the reason?

Thanks in advance.