All jQuery Codes

How to disable jQuery animation

In this post, you will find a simple jQuery tip to disable all animation. jQuery provides a property "jQuery.fx.off" which when set to true, disables all the jQuery animation. But why do you want to do that? Let's assume that you had written lots of jQuery code and you want to turn off all the […]
Read the rest of this entry »

How to set multiple CSS style using jQuery

In last post, I had explained how to select multiple element in single statement using jQuery. In this post, I will show you how can you set multiple CSS styles to any selector/element in single statement. Let's say you have a div tag and you want to set its background color to yellow, forecolor to […]
Read the rest of this entry »

How to select multiple elements in jQuery

Well, we all know how to select a single element in jQuery. $(document).ready(function(){ $("p").css('color','#FF0000'); }); But what if you come across a situation where you needs to apply some common functionality to multiple element. For example, you have couple of P tags, h1 tags and input boxes. You want to set their color to Red. […]
Read the rest of this entry »

How to Disable right click using jQuery

You can find many java script code snippets to disable right click. But jQuery makes our life easy. Below jQuery code disables the right click of mouse. $(document).ready(function(){ $(document).bind("contextmenu",function(e){ return false; }); }); See live Demo and Code We just need to bind the contextmenu event with the document element. Method 2 (Send from one of the […]
Read the rest of this entry »

How to Check element exists or not in jQuery

Have you ever thought that what will happen if you try to access an element using jQuery which does not exist in your DOM? For example, I am accessing "dvText" element in below code and that element does not exists in my DOM. var obj = $("#dvText"); alert(obj.text()); What will happen? There could be 2 […]
Read the rest of this entry »

How to set HTML of any control using jQuery

In my previous post "How to get HTML of any control using jQuery", I had explained that how can we get the HTML of any control. In this post, I will show you how can you set HTML for any control. Well, we will use the same function html() using which we get the HTML. […]
Read the rest of this entry »

Responsive Menu
Add more content here...