diff --git a/README.md b/README.md index 38549d4..70011c8 100644 --- a/README.md +++ b/README.md @@ -299,6 +299,17 @@ const example = new Choices(element, { **Usage:** The value of the inputs placeholder. +**Note:** To assign a placeholder to a single select box, assign a `placeholder` attribute to an option. For example: + +```html + +``` + ### prependValue **Type:** `String` **Default:** `null` @@ -671,6 +682,7 @@ const example = new Choices(element, { {value: 'One', label: 'Label One'}, {value: 'Two', label: 'Label Two', disabled: true}, {value: 'Three', label: 'Label Three'}, + {value: '', label: 'Choose a number...', placeholder: true}, ], }); diff --git a/index.html b/index.html index 74a0cd1..f548726 100644 --- a/index.html +++ b/index.html @@ -390,9 +390,7 @@ {value: 'Six', label: 'Label Six', selected: true}, ], 'value', 'label', false); - var singlePresetOpts = new Choices('#choices-single-preset-options', { - placeholder: true, - }).setChoices([{ + var singlePresetOpts = new Choices('#choices-single-preset-options').setChoices([{ label: 'Group one', id: 1, disabled: false, @@ -426,8 +424,6 @@ }); var singlePlaceholderOption = new Choices('#choices-placeholder-option', { - placeholder: true, - placeholderValue: 'Please Choose…', removeItemButton: false, preselectItem: false, });