Skip to content

Commit aa3bd88

Browse files
authored
Merge pull request #7315 from Dhanush111/main
fix: Correct typo, improve createRadio() method description, and simplify input tag
2 parents cfc17d3 + e4df356 commit aa3bd88

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/dom/dom.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,18 +1442,18 @@ p5.prototype.createSelect = function(...args) {
14421442
*
14431443
* The parameter is optional. If a string is passed, as in
14441444
* `let myRadio = createSelect('food')`, then each radio option will
1445-
* have `"food"` as its `name` parameter: `<input name="food"></input>`.
1445+
* have `"food"` as its `name` parameter: `<input name="food">`.
14461446
* If an existing `<div></div>` or `<span></span>`
14471447
* element is passed, as in `let myRadio = createSelect(container)`, it will
14481448
* become the radio button's parent element.
14491449
*
14501450
* Radio buttons extend the <a href="#/p5.Element">p5.Element</a> class with a few
14511451
* helpful methods for managing options:
1452-
* - `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.
1452+
* - `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.
14531453
* - `myRadio.value()` returns the currently-selected option's value.
14541454
* - `myRadio.selected()` returns the currently-selected option.
14551455
* - `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>.
1456-
* - `myRadio.disable(shouldDisable)` enables the entire radio button if `true` is passed and disables it if `false` is passed.
1456+
* - `myRadio.disable(shouldDisable)` Disables the radio button if `true` is passed, and enables it if `false` is passed.
14571457
*
14581458
* @method createRadio
14591459
* @param {Object} [containerElement] container HTML Element, either a `&lt;div&gt;&lt;/div&gt;`

0 commit comments

Comments
 (0)