jQuery Test if a Checkbox is Checked

To test if a checkbox is checked using jQuery you do it like this: $(’#checkboxid’).is(’:checked’) The :checked selector works for checkboxes and radio buttons. For select elements, use the :selected selector.

Posted at 7pm on 4/17/12 | no comments; | Filed Under: jQuery | read on

JavaScript Function Parameter Default Value

Writing functions with default values for function parameters is not like other language, like PHP for example. An easy way to set default javascript function variables is to simply check if they are undefined before you do anything with them and if they are, simply set them to the default value of your choice. If [...]

Posted at 5pm on 10/12/11 | no comments; | Filed Under: Functions, Tips & Tricks | read on

Categories

Monthly Archives