Sunday, July 17, 2011

Move (Copy) Div from one place to another using jQuery


Hello Friends,
jQuery is very useful while you develop any web application. Whatever you can do with jQuery is not enough, you should know much more and implement more and more with jQuery. Yesterday i need to move one of my “Pending” record to “Paid” records section once i click on selectbox and change the record to “Paid” status. I can do it by creating new HTMLand append it to paid records list. But i came to know about Clonefunctionality of jQuery. There are two possiblility in Clone function of jQuery. If you want to keep the Div at their place and create the same Div at some other place than you can go for Clone. If you want to Move the Div from one place to another than use appendTo. Look at below syntax.
$(“div#source_div_id”).appendTo(“div#destination_div_id”);
 If you find any problem in this than let me know by comment.

0 comments:

Post a Comment

Any Questions or Suggestions ?

About

Professional & Experienced Freelance Developer From India, Technologist, Software Engineer, internet marketer and Open Sources Developer with experience in Finance, Telecoms and the Media. Contact Me for freelancing projects.

Enter your email address:

Delivered by FeedBurner