es6-tutorial icon indicating copy to clipboard operation
es6-tutorial copied to clipboard

Missing amortization table element

Open Eitan-G opened this issue 8 years ago • 1 comments

This is not an issue with the repository itself, but with the copy & paste code in the tutorial.

In the Using Classes section in step 4. Modify the calcBtn click event handler as follows:

The line document.getElementById("amortization").innerHTML = html; is referencing an element that is nonexistent.

Uncaught TypeError: Cannot set property 'innerHTML' of null

Adding a table#amortization element after the Monthly Rate header will fix it.

<h3>Monthly Rate: <span id="monthlyRate"></span></h3>
<table id="amortization"></table>

Eitan-G avatar Apr 24 '17 00:04 Eitan-G

Or rather, the tutorial doesn't even talk about modifying the HTML file even though it's implied that the HTML file will change (..."make a copy of index.html and main.js in case you want to go back to that version." in Point 1). A strange omission to be sure.

starkipraggy avatar May 19 '17 07:05 starkipraggy