20

Stupid HTML checkboxes! It's always annoyed me that you can't just set checked to true or false, but have to remove the property altogether to uncheck a checkbox. Better still would be if you'd only need to set the value to 1 or 0, and the checked or not would sort out automatically. Yes, there are frameworks to handle it, I know. But if checkboxes had been designed right from start, a framework or any sort of special cases would not be needed. You've got love HTML, but things like this make it ugly.

Comments
  • 2
    Are you referring to markup or javascript?

    In markup yes you remove it due to the original syntax definition since you added checked keyword as an valueless attribute.

    Its not so much remove as to not add.

    In js you can set the checked property to true or false.
  • 1
    @Voxera in html javascript: not really, and you shouldn't depend on it.

    The display changes but not the value. So this will cause many bugs.
  • 0
    @Voxera Kinda both. Like @Codex404 said.
  • 2
    @Codex404 which browser does it not work in?

    https://stackoverflow.com/questions...

    That solution has been working since netscape 2 or something like that.
  • 4
    I loathe the fact that you cannot style checkboxes
  • 1
    @wokeRoach

    I've built my own many times before, but styling them directly is limited to just a few things like background color.
Add Comment