All Methods

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 »

How to use jQuery slideToggle function

In this post, I will show you how can you toggle any element based on any event. For example, on click of any button you want to show/hide any div element. You can easily achieve this by setting css of the div. I will show you how you can achieve it using jQuery without setting […]
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 »

How to get HTML of any control using jQuery

In this post, we will see that how we can get the HTML part or I should say innerHTML of any control. Well, jQuery provides a function "html()" which will give the html of the control. For example, I have placed a div control on the page which has h1 and h2 tag. <div id="dvExample"> […]
Read the rest of this entry »

Responsive Menu
Add more content here...