Short js snippets working with js jquery and bool valuesinput checkboxes

Get value of checkbox (jquery):

– returns bool true or bool false

Set value of checkbox (jquery):

Second parameter can be true or false.

Convert true or false strings to bool (js):

This is when you know the string will be ‘True’ or ‘FALSE’ for instance. Accepts all case variations of ‘TRUE’ and ‘false’.

Leave a Reply