I am fairly new to web development. Using javascript, I just tried to fill a bootstrap dropdown dynamically this way (event listener on the DOMContentLoaded event):