title: Cannot Read Property Value of Null - Javascript
body: <p>Good afternoon everybody - I have a (probably) simplistic question that I can't seem to find the answer to after searching fairly thoroughly.  The error that I'm getting in chrome is "Uncaught TypeError: Cannot read property 'value' of null." on line 120 (copied below):</p>
  
  <pre><code>mercedes_txt = mercedes_txt + "&lt;tr&gt;&lt;td&gt;&lt;button id=\"Mercedes Add Value\"
      onclick=\"addAttribute('Merceds-Benz', " + mercedes_counter + ", '" +
      document.getElementById('Mercedes-Benz Text').value + "')\"&gt;Add&lt;/button&gt;&lt;/td&gt;&lt;td&gt;
      &lt;input type=\"text\" name=\"Mercedes-Benz Text\" id=\"Mercedes-Benz Text\" /&gt;
      &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;";
  </code></pre>
  
  <p>I tried to divide the code up on multiple lines for readability purposes.  If I take out "onclick" the code executes properly.  Also, if I replace</p>
  
  <pre><code>'" + document.getElementById ('Mercedes-Benz Text').value + "'
  </code></pre>
  
  <p>with 'someValue', the code executes properly.  So the problem must be that I'm requesting the value from an object that is dynamically created (it doesn't exist yet, but will once the code is applied in an innerHTML call).  Sorry that I'm a novice but I appreciate everyone's help.</p>