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):
mercedes_txt = mercedes_txt + "<tr><td><button id=\"Mercedes Add Value\"
onclick=\"addAttribute('Merceds-Benz', " + mercedes_counter + ", '" +
document.getElementById('Mercedes-Benz Text').value + "')\">Add</button></td><td>
<input type=\"text\" name=\"Mercedes-Benz Text\" id=\"Mercedes-Benz Text\" />
</td></tr></table>";
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
'" + document.getElementById ('Mercedes-Benz Text').value + "'
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.