title: Add object property from input.value
body: <p>Say I have an object with states as properties and an html input text field.</p>
  
  <pre><code>&lt;input id="input" type="text"&gt;
  </code></pre>
  
  <hr>
  
  <pre><code>var foo = {
      "Wisconsin" : "Madison",
      "Illinois" : "Springfield"
  
  }
  </code></pre>
  
  <p>How can I add properties to foo using the input text field ?
  I tried this :</p>
  
  <pre><code> foo[input.value] = input.value;
  </code></pre>
  
  <p>but of course it didn't work...</p>
  
  <p>Thanks for your help</p>