You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* The parameter is optional. If a string is passed, as in
1444
1444
* `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">`.
1446
1446
* If an existing `<div></div>` or `<span></span>`
1447
1447
* element is passed, as in `let myRadio = createSelect(container)`, it will
1448
1448
* become the radio button's parent element.
1449
1449
*
1450
1450
* Radio buttons extend the <a href="#/p5.Element">p5.Element</a> class with a few
1451
1451
* 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.
1453
1453
* - `myRadio.value()` returns the currently-selected option's value.
1454
1454
* - `myRadio.selected()` returns the currently-selected option.
1455
1455
* - `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.
1457
1457
*
1458
1458
* @method createRadio
1459
1459
* @param {Object} [containerElement] container HTML Element, either a `<div></div>`
0 commit comments