pretty-checkbox icon indicating copy to clipboard operation
pretty-checkbox copied to clipboard

The items toggles on and off visually but not checked true or false

Open georganix opened this issue 6 years ago • 2 comments

The items toggle on and off visually but it doesn't change the state of the checkbox why and how do we achieve that?

georganix avatar Mar 23 '18 18:03 georganix

The value of the checkbox's checked property does change to either true or false, in addition to the "visual" representation you're seeing. You can check this in the console by selecting the input's element and then logging the ".checked" property. It will have a value. The library is accomplishing this "purely" through css via the checked pseudo element. You can read about that here: https://developer.mozilla.org/en-US/docs/Web/CSS/:checked.

I was confused by this at first too. You might expect to see a "checked" attribute on the input. But with this lib you won't.

steveellis avatar Mar 28 '18 01:03 steveellis

i use onclick="console.log($(this).is(':checked'))" in the radio or checkbox element, its working

cyberzilla avatar Apr 17 '18 15:04 cyberzilla