All jQuery Code Examples

Validate phone numbers using jQuery

Now days registration forms have phone numbers as mandatory field. But how to validate the entered phone number is correct or not? In this post, I will show you how to validate the phone number using jQuery. To validate the phone number, I have created a function which based on input, returns true or false. […]
Read the rest of this entry »

How to Disable DropDown List Item using jQuery

In this post, I will show you how you can disable specific items of the DropDown/ComboBox/Select element using jQuery. To disable any item, just need to add attribute "disabled" with value "disabled" to the list item. //Code Starts $(document).ready(function() { $("#ddlList option[value='jquery']").attr("disabled","disabled"); });? //Code Ends See result below. You can also disable item by their […]
Read the rest of this entry »

Open link in new tab or new popup window using jQuery

Well, do you know that opening a link in new tab and open link in a new popup window are 2 different things? And to implement both the functionality, One need to use different codes. I had never given this a thought before writing this article but I realized that these are 2 different things […]
Read the rest of this entry »

Get ASP.NET GridView Cell Value on Click using jQuery

I had already posted more than 10 ASP.NET GridView Tips and Tricks with jQuery and today you will see How to Get ASP.NET GridView Cell Value when it is clicked, using jQuery. You might be knowing that ASP.NET GridView is rendered as table -> th -> tr -> td format. All the rows are converted […]
Read the rest of this entry »

How to get querystring value using jQuery

In this post, I will show you how to get the QueryString variable value using jQuery. I have created a function which returns value of any querystring variable. Earlier I had posted about Get Page Title and URL using jQuery, Get previous page URL using jQuery, Check for '#' hash in URL using jQuery, Style […]
Read the rest of this entry »

Add default option to ASP.NET Dropdown list using jQuery

Sometimes It is required to add default option like "Please Select" or "Select" in Dropdown list. Below is a simple jQuery code to "add default option to ASP.NET Dropdown list using jQuery". //Code Starts $(document).ready(function(){ var defaultOpt = "<option selected='selected' value='-1'>--Select--</option>" $('#<%=ddlCountry.ClientID %>').prepend(defaultOpt); }) //Code Ends And if you want to add default option to […]
Read the rest of this entry »

Responsive Menu
Add more content here...