Changed input.value to input.selected for selection types.