title: Jquery change value of one element to another based on click
body: <p>I need to get element value of <code>#answer_comment</code> and show it inside input with id <code>#comment</code> </p>
  
  <pre><code>$(document).ready(function() {
      $("body").on("click", "#answer_comment", function(e) {
          var answer = document.getElementById('answer_comment').val();
      $('#comment').val(answer);
  
      })
  </code></pre>
  
  <p>what is wrong?</p>
  
  <p>Also if possible, how to create a cookie with the selected value?</p>