I have a code which was supposed to toggle color between transparent and white on button click. This is the codepen link.
The div
I want the color changed has the class points
<div class="points">100 points</div>
But running this javascript code returns an error
document.getElementsByClassName('points').style.color = color;
Uncaught TypeError: Cannot read property 'color' of undefined