Drop Down menu just like envato's forums

I believe it is possible, tried this article but since I know nothing about javascript, couldn’t figure it out how to add a drop down to the menu (Text with icon that is linked). If I could manage to add a working menu with dropdown, I would write the css myself.

This is what I used to create a single link:

    api.decorateWidget('header-icons:before', helper => {
        return helper.h('li', [
            helper.h('a#iconAndText.icon', {
                href: 'https://www.discourse.org/',
                title: 'Discourse'
            }, [ 
                helper.h('i.fa.fa-home.home-button-icon.d-icon'), 
                helper.h('span', 'Home')
            ])
        ]);
    });

CSS:
    #iconAndText {
        width: initial;
        min-width: 2.2857em;
    }