How to Check a Checkbox Using jQuery

To check a checkbox in jQuery, we make use of prop() function.  This function is only available in jQuery 1.6 or higher.  For jQuery 1.5 or lower, please make use of attr() function.  Example is given below for jQuery 1.6 or higher. <!DOCTYPE html> <html> <head> <title>jQuery Tutorial </title> <script src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript"> //Function to

isNaN() Function in JavaScript

NaN stands for not a number in JavaScript.  Floats and integers are basically numbers.  IsNaN() function checks whether the value is number or not.  It will return true or false. This function will be helpful in case you want to avoid users from passing any value other than a number.   Example is given below where

String to Float Conversion in JavaScript

Floats are decimal numbers.  Similar to previous tutorial, if a float number is inside a quotation marks, it is treated as string by JavaScript.  To convert a string to float, we make use of parseFloat() function.  Example is given below. <html> <head> <title>JavaScript Tutorial </title> </head> <body> <script type="text/javascript"> var f1 = "1.35"; var f2