src/aria/widgets/form/Select.js
function (value) {
            var selectField = this.getSelectField();
            var options = selectField.options;
            for (var i = 0; i < options.length; i++) {
                var option = options[i];
                if (option.value === value) {
                    option.selected = true;
                    return;
                }
            }
            // In case we do not find any option matching the value, let's make sure no option
            // is selected, this is especially necessary because of a weird bug in Chrome:
            selectField.selectedIndex = -1;
        }
function (value) {
            var selectField = this.getSelectField();
            var options = selectField.options;
            for (var i = 0; i < options.length; i++) {
                var option = options[i];
                if (option.value === value) {
                    option.selected = true;
                    return;
                }
            }
            // In case we do not find any option matching the value, let's make sure no option
            // is selected, this is especially necessary because of a weird bug in Chrome:
            selectField.selectedIndex = -1;
        }
function ( value ) { var selectField = this . getSelectField ( ) ; var options = selectField . options ; for ( var i = 0 ; i < options . length ; i ++ ) { var option = options [ i ] ; if ( option . value === value ) { option . selected = true ; return ; } } // In case we do not find any option matching the value, let's make sure no option // is selected, this is especially necessary because of a weird bug in Chrome: selectField . selectedIndex = - 1 ; }
Set the 'selected' attribut on each options to true or false depending on the value
@param {String} value The value to compare
@private
Set the selected attribut on each options to true or false depending on the value