title: JSON with document.getElementById()
body: <p>I'm a little confused with this json. I can type in json manually without document.getElementById("anID"); and it works fine. I keep getting unterminated string literal. Can someone show me the correct way of combining [multiple] document.getElementById() and sending them through json?</p>
  
  <pre><code>var form = '{"first_name":"'+document.getElementById("first_name").value+'",
               "last_name":"'+document.getElementById("last_name").value+'"}';
  
  var form = JSON.parse(form);       
      alert(form['first_name']);
      alert(form.last_name);
  </code></pre>