Please assist with Javascript code for my tip calculator

Hey everyone.
I am struggling to run my javascript code. The error is "Cannot read property ‘style’ of undefined " when I tick the checkbox for Split Bill
link to the codepen

Please assist on what I could be overlooking and thank you in advance

First, you have two elements with same classname.
Secand, document.getElementsbyClassName will return HTML collection.
Array like HTML collection. Since you have two elements with the same class name, HTML collection will also return two elements like [elemnt 1, element2].

Hint: try to console.log it.

1 Like

That makes sense. Thank you for your feedback. Will work on fixing that now