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 https://codepen.io/tshenolo-lobelo/pen/wvaEXzp
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].