Skip to content

Commit

Permalink
Merge pull request #5777 from ggorlen/clarify-select-option
Browse files Browse the repository at this point in the history
Clarify select option behavior
  • Loading branch information
Qianqianye authored Sep 2, 2022
2 parents 69fd5e9 + 0cc10c4 commit fe0f15b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dom/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href="#/p5.Element">p5.Element</a> 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 <a href="#/p5.Element">p5.Element</a> 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 <a href="#/p5.Element">p5.Element</a>.
* - `.selected(value)` can be used to make given option selected by default when the page first loads.
Expand Down

0 comments on commit fe0f15b

Please sign in to comment.