Skip to content

Commit

Permalink
Merge pull request #7315 from Dhanush111/main
Browse files Browse the repository at this point in the history
fix: Correct typo, improve createRadio() method description, and simplify input tag
  • Loading branch information
davepagurek authored Nov 8, 2024
2 parents cfc17d3 + e4df356 commit aa3bd88
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dom/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -1442,18 +1442,18 @@ p5.prototype.createSelect = function(...args) {
*
* The parameter is optional. If a string is passed, as in
* `let myRadio = createSelect('food')`, then each radio option will
* have `"food"` as its `name` parameter: `<input name="food"></input>`.
* have `"food"` as its `name` parameter: `<input name="food">`.
* If an existing `<div></div>` or `<span></span>`
* element is passed, as in `let myRadio = createSelect(container)`, it will
* become the radio button's parent element.
*
* Radio buttons extend the <a href="#/p5.Element">p5.Element</a> class with a few
* helpful methods for managing options:
* - `myRadio.option(value, [label])` adds an option to the menu. The first paremeter, `value`, is a string that sets the option's value and label. The second parameter, `label`, is optional. If provided, it sets the label displayed for the `value`. If an option with `value` already exists, its label is changed and its value is returned.
* - `myRadio.option(value, [label])` adds an option to the menu. The first parameter, `value`, is a string that sets the option's value and label. The second parameter, `label`, is optional. If provided, it sets the label displayed for the `value`. If an option with `value` already exists, its label is changed and its value is returned.
* - `myRadio.value()` returns the currently-selected option's value.
* - `myRadio.selected()` returns the currently-selected option.
* - `myRadio.selected(value)` selects the given option and returns it as an <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement" target="_blank">`HTMLInputElement`</a>.
* - `myRadio.disable(shouldDisable)` enables the entire radio button if `true` is passed and disables it if `false` is passed.
* - `myRadio.disable(shouldDisable)` Disables the radio button if `true` is passed, and enables it if `false` is passed.
*
* @method createRadio
* @param {Object} [containerElement] container HTML Element, either a `&lt;div&gt;&lt;/div&gt;`
Expand Down

0 comments on commit aa3bd88

Please sign in to comment.