bigskysoftware / _hyperscript

a small scripting language for the web
BSD 2-Clause "Simplified" License
2.92k stars 144 forks source link

how to uncheck a radio #546

Open glfeng318 opened 3 weeks ago

glfeng318 commented 3 weeks ago

<input type="radio" name="expand" _="on click halt the event remove [@checked] on me" class="ml-4"> not work as expected. And how to toggle @checked attribute of a radio?

Nicero commented 2 days ago

Simply remove [ and ]:

_="on click remove @checked"

What behaviour should have a toggle radio button?

_="on click if me match <:checked/> ..." _="on click if me match <:not(:checked)/> ..."