title: What's should setting an HTML textbox value to null do?
body: <p>We have a JSON response which can contain null values (e.g. { myValue: null }) - we assign this value to a textbox on a form: (actually, we use JQuery, but this is equivalent</p>
  
  <pre><code>var nullString = null;
  document.getElementById('myInput').value = nullString;
  </code></pre>
  
  <p>If we assign this value to an HTML textbox value, the behaviour seems browser-dependent:</p>
  
  <ul>
  <li><p>Firefox and Chrome both display an empty text box, and when you read 'value' back you get null.</p></li>
  <li><p>IE puts the string 'null' into the text box, and when you read 'value' back, you get the string "null" (i.e. setting 'value' and reading it back has modified the data)</p></li>
  </ul>
  
  <p>(It's here: <a href="http://jsbin.com/uleno/edit" rel="nofollow noreferrer">http://jsbin.com/uleno/edit</a> if anyone wants to try it)</p>
  
  <p>Which browser is doing the right thing here, or is this undefined behaviour?  And is there a cleverer more elegant workaround than doing a lot of (myValue == null ? '' : myValue) stuff?</p>