I want to know the use of clone in jquery.
Enter your jQuery question at the top of this page and click Get An Answer.
Tell us how quickly you want your jQuery question answered.
Connect with your programmer via online chat or telephone call.
I want to know the use of clone in jquery.
clone(): element data will be copied
here is a good example:
here is soem html divs:
<div class="container">
<div class="hello">Hello</div>
<div class="goodbye">Goodbye</div>
</div>
the following code will copy a div and append it to another div.
$('.hello').clone().appendTo('.goodbye');
here is the resultant output:
<div class="container">
<div class="hello">Hello</div>
<div class="goodbye">
Goodbye
<div class="hello">Hello</div>
</div>
</div>
thank you.
Byron Narciso
Programmer
Whether you have a quick question while preparing your taxes, troubleshooting a computer problem, or need to hire an attorney, ExpertHelp is the most convenient and affordable way to connect with the right service professional to get the job done.
ExpertHelp has been in business since 2011, is an A+ Rated Better Business Bureau accredited member, and offers a 100% satisfaction guarantee on every question you ask!