Archive for May, 2011

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 »

How to set focus on next textbox on Enter Key using jQuery

I had already posted about "How to Set focus on First textbox of page using jQuery", but there was a situation where I need to move to next textbox using Enter key. Normally, tab key is used to move to next text box and by default, when Enter key is pressed, the form gets submitted […]
Read the rest of this entry »

Get total count of textboxes using jQuery

Today,One of my colleague asked me that how to get total number of textbox count using jQuery. This was fairly simple. You can use the length property to get count of textbox. See below jQuery code. $(document).ready(function() { alert($("input:text").length); }); In this jQuery code, first selecting all the textbox and then taking it's length to […]
Read the rest of this entry »

How to Set focus on First textbox of page using jQuery

In any webpage where there are lots of input controls and you want the foucs on the first text box when the page is loaded. It is a piece of cake with jQuery. See below code. $(document).ready(function() { $('input:text:first').focus(); }); See live Demo and Code. But there could be one problem with this approach, if […]
Read the rest of this entry »

jQuery.holdReady() New in jQuery 1.6

With Release of jQuery 1.6, jQuery team has released a new method "jQuery.holdReady(hold)". This method allows to delay the execution of document.ready() event. document.ready() event is called as soon as your DOM is ready but sometimes there is a situation when you want to load additional JavaScript or some plugins which you have referenced. In […]
Read the rest of this entry »

What’s new in jQuery 1.6

Well, jQuery 1.6 is now live and available for consumption! You can get the code from the jQuery CDN: http://code.jquery.com/jquery-1.6.js http://code.jquery.com/jquery-1.6.min.js You can also get the code from other CDNs as well: Microsoft: http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.min.js (Google is still uploading their copy.) Read "How to always reference latest version of jQuery". Along with some bug fixes, some new […]
Read the rest of this entry »