Last Updated:
29 Mar 2024 08:26
by Thomas
To enhance UX, it should be better that when the user clicks between the label and the checkbox/radiobutton, it actionnates the checkbox/radiobutton.
Today this is how a radiobutton is structured.
An improvement would be to nest the input inside the label, so it does what i said above, eg. :
<label>
<input type="checkbox" id="myCheckbox" name="myCheckbox">
Click me to toggle the checkbox
</label>
This would greatly enhance UX and is very common in web development.