Vanilla JS equivalent for counting number of child elements using className

A Pen by Param-Harrison