I probably over complicated it, but here's a CodePen link with how I did it in JS and outputted it to the HTML side.
Long as you solved it! 👍
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.