| 1. |
What Is The Use Of Clone Method And Give An Example To Create It In Jquery? |
|
Answer» “Clone” method is used to clone the set of CONTROLS, which basically MEANS to copy the set of ELEMENTS which are matched on selectors. It copies the DESCENDANT elements along with the parent element. For example: $(document).ready(function(){ $('#mycontrolid').click(function(){ $('#mycontrolid').clone().appendTo('body'); return false; }); }); “Clone” method is used to clone the set of controls, which basically means to copy the set of elements which are matched on selectors. It copies the descendant elements along with the parent element. For example: $(document).ready(function(){ $('#mycontrolid').click(function(){ $('#mycontrolid').clone().appendTo('body'); return false; }); }); |
|