Difference Between jQuery().each() and jQuery.each()

jQuery has 2 different methods jQuery().each() (Also written as "$.each()") and jQuery.each(). Both the methods are similar in nature used for iteration or looping but the differ only at the level where they are used. jQuery.each(): is used to iterate, exclusively, over a jQuery object. When called it iterates over the DOM elements that are […]
Read the rest of this entry »

jQuery: Restrict occurrence of specific word in textbox

Below jQuery code allows to restrict user to enter any specific word only once in textbox. For demo, I have used "article" word and it should occur only once in textbox. The code also makes case insensitive search. $(document).ready(function () { $('#txtDesc').bind('keyup', function () { var txtToMatch = /article/gi; var iLimit = 1; var sMatch […]
Read the rest of this entry »

Detect Scroll Position (Up/Down) using jQuery

Below jQuery code detects whether user is scrolling up or down in the webpage. var iScrollPos = 0; $(window).scroll(function () { var iCurScrollPos = $(this).scrollTop(); if (iCurScrollPos > iScrollPos) { //Scrolling Down } else { //Scrolling Up } iScrollPos = iCurScrollPos; }); Live Demo Feel free to contact me for any help related to jQuery, […]
Read the rest of this entry »

jQuery: Select all readonly input type textbox

In this short post, find jQuery code to select all readonly input type textboxes present on the page. $(function(){ $(":input[type=text][readonly='readonly']").val(""); }); However, if you have single readonly textbox element, then select it using its ID. And if you want to exclude all readonly input type textboxes from selection, then use below jQuery code. $(function(){ $(":input[type=text]:not([readonly='readonly'])").val(""); […]
Read the rest of this entry »

Download jQuery Interview Questions free eBook

Free eBook to download jQuery interview question and answers in PDF format. These are the question which You'll Most Likely Be Asked in an interview. This is a same list which few days ago, I had posted about Latest jQuery interview questions and answers and the response was quite good. So now you can also […]
Read the rest of this entry »

Latest jQuery interview questions and answers

Below is the list of latest and updated jQuery interview questions and their answers for freshers as well as experienced users. These interview question covers latest version of jQuery which is jQuery 2.0. These interview questions will help you to prepare for the interviews, quick revision and provide strength to your technical skills. Q1. What […]
Read the rest of this entry »

Responsive Menu
Add more content here...