I would like to make 3 radio buttons and I would like to get the value of checked one when I press a button.
<py-script>
<input id="rad1" name="choice" type="radio">
<label for="rad1">1</label>
<input id="rad2" name="choice" type="radio">
<label for="rad2">2</label>
<input id="rad3" name="choice" type="radio">
<label for="rad3">3</label>
<button id="btn">Go</button>
<py-script>
from js import document
from pyodide import create_proxy
def on_btn_click(event):
global choice
checked_value = ___???___ ← ← ← ← ← ← ← ← ← ← ← ← ← ← ← ← ← ← ←
choice = checked_value
button = document.querySelector("#btn")
button.addEventListener("click", create_proxy(on_btn_click))
</py-script>
What is missing in the ??? ← ← ← ← ← ← ← in order to grab the checked value in the function handler?
