Cover Image for How to check if checkbox is checked in jQuery?

How to check if checkbox is checked in jQuery?

It is very easy to check if a checkbox is checked in jQuery using the .is() or .prop() method of jQuery combined with the ‘:checked’ selector. There are other ways too like checking for the attribute checked value, however, they aren’t very reliable. The easiest and most stable way to check if checkbox is checked … Read more

MoreOnFew
Cover Image for How to check if an element is hidden in jQuery?

How to check if an element is hidden in jQuery?

Whether you are new to jQuery or not, you must have come across a situation where you had to check if an element is hidden in jQuery. While this might sound like an easy task, it can get tricky. Don’t worry, you can check if an element is hidden in jQuery using the simple ways … Read more

MoreOnFew
Cover Image for How to remove multiple attributes in jquery?

How to remove multiple attributes in jquery?

Many a time you might have come across a scenario where you would want to remove multiple attributes from an element. For example, consider the following DIV : Now using jQuery’s removeAttr() method you want to remove both the data-id and data-module attributes. Many of us try to use multiple calls to the removeAttr() method … Read more

MoreOnFew
Cover Image for How to check jQuery version?

How to check jQuery version?

Many of us might have come across scenarios wherein we wanted to do something based on the version of the jQuery loaded. To be specific I’m talking about scenarios where one might want to know the version of jQuery programmatically and if the version was say 1.3.2 then load some other files too or do something … Read more

MoreOnFew
Cover Image for How to make placeholder work in IE ?

How to make placeholder work in IE ?

One of the interesting features of HTML5 is the “placeholder” attribute. This new attribute has helped web developers save a lot of time as without it we would have had to write JavaScript code to simulate the same. But now with the arrival of placeholder attribute we just need to include this attribute in our input fields … Read more

MoreOnFew
Cover Image for Understanding jQuery animate function

Understanding jQuery animate function

jQuery’s .animate() function has helped many front end developers around the world to create web pages with custom animations and effects by just using combinations of jQuery , css and sometimes images. It helped us get rid of flash for most of the simple (and at times complex) animations. And I must say that this … Read more

MoreOnFew
Cover Image for How to detect keycode / key pressed in jquery

How to detect keycode / key pressed in jquery

Tracking a keyCode can be very helpful if you would like to give your visitors a user-friendly experience. For instance, if there is an overlay open on a page, I usually press the ESC (Escape) button to close the overlay and most of the sites nowadays respond to it and close the overlay. It wouldn’t … Read more

MoreOnFew
Cover Image for How to generate QR Code using jQuery

How to generate QR Code using jQuery

QR Code or the Quick Response Code is a square-shaped matrix barcode that contains data encoded within it. QR Codes can be generated using JavaScript or jQuery too and in this article, we’ll concentrate on how to generate QR code using jquery. QR Codes have become very common in recent times especially among portable devices … Read more

MoreOnFew
Cover Image for What is the difference between .prev() , .prevAll() and .prevUntil()  jQuery APIs ?

What is the difference between .prev() , .prevAll() and .prevUntil() jQuery APIs ?

jQuery has made a drastic change in the way JavaScript are written. It has given more scripting power to the developers and the ability to “write less and do more” . Recently a friend of mine, who is a newbie Javascript developer, came across the .prev() , .prevAll() and the .prevUntil() APIs of jQuery. He … Read more

MoreOnFew