From 0cc10c45d7e5789f9358ad09989af1de350d3bf9 Mon Sep 17 00:00:00 2001 From: ggorlen Date: Wed, 31 Aug 2022 13:30:20 -0700 Subject: [PATCH] Clarify select option behavior --- src/dom/dom.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dom/dom.js b/src/dom/dom.js index c15484496a..8b0e59a193 100644 --- a/src/dom/dom.js +++ b/src/dom/dom.js @@ -622,8 +622,8 @@ p5.prototype.createCheckbox = function() { /** * Creates a dropdown menu `<select></select>` element in the DOM. - * It also helps to assign select-box methods to p5.Element when selecting existing select box. - * - `.option(name, [value])` can be used to set options for the select after it is created. + * It also assigns select-related methods to p5.Element when selecting an existing select box. Options in the menu are unique by `name` (the display text). + * - `.option(name, [value])` can be used to add an option with `name` (the display text) and `value` to the select element. If an option with `name` already exists within the select element, this method will change its value to `value`. * - `.value()` will return the currently selected option. * - `.selected()` will return the current dropdown element which is an instance of p5.Element. * - `.selected(value)` can be used to make given option selected by default when the page first loads.