All jQuery Tips

Common Dropdown operation (Get, Set, Add, Remove) using jQuery

DropDown list is a very basic and common control and You might be using either ASP.NET Dropdown list or normal html dropdown list in your project. In this post, I have put together the code examples for all kind of dropdown operation. For example, to get selected value from dropdown, for to set value in […]
Read the rest of this entry »

Get Radio Button value using jQuery

Here’s small piece of code to get the value of a checked or selected radio button out of a group of radio buttons. var selValue = $('input[name=rbnNumber]:checked').val(); In above code, rbnNumber is name of the radio group. Demo HTML Code: jQuery Code: Result: See Complete Code You can also get the value of individual radio […]
Read the rest of this entry »

Get checkbox status using jQuery

Below single line of code will provide the status of checkbox using jQuery. It checks whether the checked is checked or not using jQuery and will return 1 or 0. var isChecked = $('#chkSelect').attr('checked')?true:false; I have noticed that on many website it is written that 'checked' attribute will return true or false, but this is […]
Read the rest of this entry »

How to check element visible or hidden using jQuery

Below is a simple piece of jQuery code which checks the visibility of element using jQuery. jQuery provides "visible" selector which can be used to check the visibility. Earlier I had posted about How to check if element is empty, Difference between empty() vs remove() and Don't use jQuery.size() to count number of element. And […]
Read the rest of this entry »

Extract numbers from string using jQuery

Today I got into a situation where I need to extract the numbers from the string variable on client side using jQuery. If a string has 1 or more occurrence of the numbers then also need to extract it and store it into an array. For example, if the string is var str = '3jquery33By333Example3333'; […]
Read the rest of this entry »

Difference between sorting string array and numerical array in jQuery

To sort any array, there is a predefined method called "sort" which sorts the array. sort() method sorts the string array in alphabetical order. This method sorts on the basis of the Unicode code points, so it is better to have all uniform names. That is, they must begin with either uppercase or lowercase, but […]
Read the rest of this entry »

Responsive Menu
Add more content here...