All jQuery Selectors

Disable-Enable all controls of page using jQuery

In this post, I will demonstrate a simple jQuery code to disable and enable all the controls of the page. jQuery provides (*) selector, which selects all the element of the page. We will use the * selector to disable and enable all the elements. For demo purpose, we will disable and enable controls on […]
Read the rest of this entry »

How to use jQuery Selectors with Examples

To work with an element on the web page, first we need to find them. To find the html element in jQuery we use selectors. jQuery provides many selectors out of the box. Let me explain some of the very useful selectors in “how to” ways. How to select all elements of the page? - […]
Read the rest of this entry »

addClass, removeClass, hasClass and toggleClass in jQuery

In this post, I will explain about some of the basic but useful jQuery css selectors. These CSS selectors are used to add or remove CSS class, to check whether element has specific css class associated with it or not. Believe me these are basic, but pretty useful. Add cssClass to specific element $('#element').addClass('myclass'); Remove […]
Read the rest of this entry »

Tips to use jQuery selectors efficiently

It is pretty important to understand how to write efficient element selection statement. One has to be very careful while jquery selector statement. Below are some tips on how to use your jQuery selectors efficiently. 1. Always try to use ID as selector You can use ID as selector in jQuery. See below jQuery code. […]
Read the rest of this entry »

jQuery selectors code snippets demo

Selector is the most basic things in jQuery. Their use is very simple and straight and correct use of selectors can enhance the efficiency of writing jQuery code. I have put together some of the common selectors which are pretty common. ID Selector $(document).ready(function () { $('#dvDummy').css('background', '#000000'); }); Class Selector $(document).ready(function () { $('.class1').css('background', […]
Read the rest of this entry »

OOPS!!!! jQuery Selectors NOT working…

OOPS!!!! jQuery Selectors NOT working.. A very common jQuery problem/issue that you must have face or may face. And there could be tons of reason of selectors not working properly like incorrect syntax, incorrect context.. But do you know there could be another reason which is element ID or css class name? Yes, you read […]
Read the rest of this entry »