title: How can I get my checkbox data into text area box in html using js or jquery?
body: <p>I have a html form that has check box and text area. When I check the check box, I want it to be dynamically update the text area with its value. what am I doing wrong? here is the code:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="ISO-8859-1"&gt;
  &lt;title&gt;Sample Web page&lt;/title&gt;
  &lt;script type="javascript"&gt;
     function changeTA() {
     var inputElements = document.getElementByName("favorite_pet");
         for(var i=0; inputElements[i]; ++i){
             if(inputElements[i].checked){
                 $('#ta').val($('#ta').val()+inputElements[i].value); 
       }
     }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form&gt;  
     &lt;legend&gt;What is Your Favorite Pet?&lt;/legend&gt;  
     &lt;input type="checkbox" name="favorite_pet" id="check_cat" value="Cats" onchange="changeTA()"&gt;Cats&lt;br&gt;  
     &lt;input type="checkbox" name="favorite_pet" id="check_dog" value="Dogs" onchange="changeTA()"&gt;Dogs&lt;br&gt;  
     &lt;input type="checkbox" name="favorite_pet" id="check_bird" value="Birds" onchange="changeTA()"&gt;Birds&lt;br&gt;  
         &lt;br&gt;  
  
     &lt;textarea id="ta" rows="4" cols="50"&gt;
     &lt;/textarea&gt;
  &lt;/form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>