📑 Creates a radio button group.
Use the option(label, value) function to add new radio buttons to the group.
option(label, value)
Use the value property to get or set the value of the selected radio button.
value
Optional
await Canvas(200, 160);let radio = createRadio();radio.option('square', '1');radio.option('circle', '2');q5.draw = function () { background(0.8); if (radio.value == '1') square(-40, -40, 80); if (radio.value == '2') circle(0, 0, 80);}; Copy
await Canvas(200, 160);let radio = createRadio();radio.option('square', '1');radio.option('circle', '2');q5.draw = function () { background(0.8); if (radio.value == '1') square(-40, -40, 80); if (radio.value == '2') circle(0, 0, 80);};
📑 Creates a radio button group.
Use the
option(label, value)function to add new radio buttons to the group.Use the
valueproperty to get or set the value of the selected radio button.