DEV Community

Discussion on: Create custom keyboard accessible checkboxes

Collapse
 
link2twenty profile image
Andrew Bone

Right, now that I'm on a desktop this is how I tend to do things

jsfiddle.net/link2twenty/3nrczx2q/

The main difference is the way I handle the HTML

<label class="md_checkbox">
  <input type="checkbox" />
  <span class="md_checkbox__tick"></span>
  Checkbox
</label>

I do it this way so you don't have to have an ID for each checkbox.

Are you planning on turning this into a series for different input types?

Thread Thread
 
lkopacz profile image
Lindsey Kopacz

I have to read more into this and do some testing, I've always been yelled at for not having associations between inputs and labels, but I can see why having an ID for every checkbox may get annoying.

I have to sign into the day job, but I wanna look into this tonight and get back to you :)