function delegateSelect(evt)
    {
        let child;
        for (let i = 0; i < evt.target.parentNode.children.length; i++) {
            child = evt.target.parentNode.children[i];
            if (child === evt.target)
                child.dataset.selected = true;
            else
                child.dataset.selected = false;
        }

        const select = document.getElementById(evt.target.parentNode.dataset.for);
        select.parentNode.querySelector('.active').textContent = evt.target.textContent;
        select.querySelector('option').value = evt.target.dataset.value;
    }
/* ------------------------------------------------------------------------
     * delegateSelect:
     * ------------------------------------------------------------------------
     * param evt - Javascript evt
     *
     * Pass the text content from the mock select option to the actual select
     * element to trigger the actual selection event.
     */


param evt - Javascript evt

Pass the text content from the mock select option to the actual select
element to trigger the actual selection event.
param evt - Javascript evt Pass the text content from the mock select option to the actual select element to trigger the actual selection event .
function delegateSelect(evt)
    {
        let child;
        for (let i = 0; i < evt.target.parentNode.children.length; i++) {
            child = evt.target.parentNode.children[i];
            if (child === evt.target)
                child.dataset.selected = true;
            else
                child.dataset.selected = false;
        }
        const select = document.getElementById(evt.target.parentNode.dataset.for);
        select.parentNode.querySelector('.active').textContent = evt.target.textContent;
        select.querySelector('option').value = evt.target.dataset.value;
    }
function delegateSelect ( evt ) { let child ; for ( let i = 0 ; i < evt . target . parentNode . children . length ; i ++ ) { child = evt . target . parentNode . children [ i ] ; if ( child === evt . target ) child . dataset . selected = true ; else child . dataset . selected = false ; } const select = document . getElementById ( evt . target . parentNode . dataset . for ) ; select . parentNode . querySelector ( '.active' ) . textContent = evt . target . textContent ; select . querySelector ( 'option' ) . value = evt . target . dataset . value ; }
delegateSelect:
delegateSelect :