How to dynamically populate a dropdown

Well, here’s my best shot, although when I add another item to the dropdown, the styling gets weird. https://codepen.io/bfoley650/pen/PoZwKeb

error code: 523