All jQuery Methods

How to use hover method in jQuery

In my earlier post, I have posted about how to provide highlight effect on mouseover and mouseout using jQuery events. Today, I found another solution which is easy and compact. jQuery provide hover() event which works for both the events. It works for mouseover and it also works for mouseout. Below jQuery code uses the […]
Read the rest of this entry »

How to highlight on mouseover using jQuery

In this post, I will show you a tip/trick to provide highlighting effect on mouseover and mouseout. For demo purpose, we will create a css class which will set the background color of element. This css class will be added to element on mouseover and it will be removed on mouseout. To achive this, we […]
Read the rest of this entry »

How to remove space from begin and end of string using jQuery trim

Below jQuery code remove spaces from begin and end of string using trim function of jQuery. $(document).ready(function(){ var strVal = " jQuery By Example "; strVal = jQuery.trim(strVal); alert(strVal); }); When you run this code, "jQuery By Example" will be displayed in alert box. trim() will remove the space from begin and end of any […]
Read the rest of this entry »

jQuery – bind() vs live() vs delegate() methods

I had already posted about jQuery bind(), jQuery live() and  jQuery delegate() functions. All the three jQuery functions are used to attach events to selectors or elements. But just think why there are 3 different functions for same purpose? There can't be. right? So in this post, I will explain you how these functions are […]
Read the rest of this entry »

jQuery delegate method Example/Demo

With jQuery 1.4.2 launch, a new method called "delegate()" was introduced. This method attaches a handler to one or more events for selected/specified elements. Let's take an example. I have created a table and using delegate method, I will attach the click event handler to every td element. <table border="1" width="200px" cellspacing="5" cellpadding="5"> <tr> <td>Item […]
Read the rest of this entry »

Difference between jQuery parent() and parents() methods

In this post, we will see what is the difference between parent() and parents() methods. To understand this, let's look at the below given html code. <html> <body> <form id="form1" runat="server"> <div id="dvParent"> <div id="dvChild"> <p><span id="spnText">jQuery By Example Rocks!!!</span> </p> </div> </div> </form> </body> </html> As you see there 2 divs, 1 p and […]
Read the rest of this entry »

Responsive Menu
Add more content here...