title: JavaScript push to array object is not working
body: <p>I have an html like below</p>
  
  <p>HTML:</p>
  
  <pre><code> &lt;INPUT TYPE=CHECKBOX NAME="clcik" onClick="add('1234','blah')" /&gt;
   &lt;input type="hidden" id="project" value="" /&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>    function add(obj1 , obj2){
      var jsonArray = [];
      var jsonObj = { product_id : obj1 , name : obj2 };
      jsonArray.push(jsonObj);
      var field = document.getElementById('project');
      field.setAttribute('value', JSON.stringify(jsonArray));
      alert(field.getAttribute('value'));
      }
  </code></pre>
  
  <p>I am trying to set first and retrieve again to check but nothing is happening..I can't understand where I am wrong...?</p>