All jQuery Codes

jQuery- Parse JSON, XML and HTML

In this post, find out jQuery code on how to parse JSON, parse XML and parse HTML. If you are still using custom code for parsing any of these and making your life more miserable then stop doing it. Why? If you are not aware then here is a news for you that jQuery has […]
Read the rest of this entry »

Highlight Negative value columns in ASP.NET GridView using jQuery

In this post, find jQuery code to highlight negative value columns/cells in ASP.NET GridView. This is a helpful feature as it draws user's attention immediately and informs him that there is something wrong with some of the entities. Related Post: jQuery.isNumeric in jQuery 1.7 Download ASP.NET GridView & jQuery Tips and Tricks eBook PDF Common […]
Read the rest of this entry »

jQuery – Convert string to float or double

Find code to convert String to float or double using jQuery. To convert, use JavaScript parseFloat() function parses a string and returns a floating point number. var sVal = '234.54'; var iNum = parseFloat(sVal); //Output will be 234.54. Related Post: jQuery- Convert string to Integer jQuery to round off decimal values jQuery Code: Change text […]
Read the rest of this entry »

jQuery – Convert string to integer

Find code to convert String to Integer using jQuery. To convert, use JavaScript parseInt() function which parses a string and returns an integer. var sVal = '234'; var iNum = parseInt(sVal); //Output will be 234. Related Post: jQuery to round off decimal values jQuery Code: Change text to Uppercase The syntax of parseInt() function is, […]
Read the rest of this entry »

jQuery to round off decimal values

To round off decimal values using jQuery, we can use the built-in JavaScript methods toFixed() or toPrecision(). The toFixed() method converts a number into a string, keeping a specified number of decimals. var iNum = 12345.6789; iNum.toFixed(); // Returns "12346": note rounding, no fractional part iNum.toFixed(1); // Returns "12345.7": note rounding iNum.toFixed(6); // Returns "12345.678900": […]
Read the rest of this entry »

jQuery to count words in each paragraph

Find jQuery code to count number of words in each paragraph or HTML <p> tag element. Below jQuery code does following things. Iterates through each paragraph element. Split the paragraph text using space. Split() returns array so take the length of array which represents number of words. Then appends the count to paragraph itself. $(document).ready(function() […]
Read the rest of this entry »

Responsive Menu
Add more content here...