Skip to content

Clarify select option behavior #5777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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