All jQuery Tips

jQuery code to check if all textboxes are empty

Find jQuery code to check if all the input type 'text' element or textboxes are empty or not. This is quite useful for validation. This jQuery code loops through all the textboxes and check their value. If value is empty then it adds a red color border to let user know that this field is […]
Read the rest of this entry »

jQuery code to get dropdown values in comma separated list

Yesterday I needed to get all the dropdown values and create a comma separated list. One way to iterate through all dropdown elements and create string. But I found there is another way to achieve this. Use jQuery $.map() which applies a function to each item in an array or object and maps the results […]
Read the rest of this entry »

Make a div disappear or appear after few seconds with jQuery

You must have seen this effect when a particular element is visible for few seconds and then it fades out. Such things are used for notifications. You can also implement the same in your web application with jQuery. It is really very simple. Find below jQuery code to show the div for 3 seconds and […]
Read the rest of this entry »

jQuery code to reverse ordered list child elements

In this short post, Find best method to reverse the order of child element on an ordered list using jQuery. $(document).ready(function() { $("#btnReverse").click(function() { var list = $('ol'); var listItems = list.children('li'); list.append(listItems.get().reverse()); }); });??????? See result below Feel free to contact me for any help related to jQuery, I will gladly help you.
Read the rest of this entry »

jQuery code to get absolute Image Path

It is a common practice to use relative path for images used in web application. The advantage of using relative path is that it can be easily migrated. One can easily migrate the web application from one domain to another without changing path of the images. But there can be a certain situations where you […]
Read the rest of this entry »

Make jQuery contains selector case insensitive

jQuery has ":contains" selector which can be used to select all elements with specific text. But default behavior of contains selector is case sensitive. For ":contains" the word "jquery" and "jQuery" are different. Let's find out using a simple demo. Below jQuery code will hide all the "p" tag element which contains "jquery" as text. […]
Read the rest of this entry »

Responsive Menu
Add more content here...