The .clone() function is useful to copy a portion of code somewhere in a page.
For example if you have a menu like this:
For example if you have a menu like this:
This is the code where you will see the cloned menu:
And this is the jQuery call to clone the DIV with class .menu in the DIV with class .menubox:
$(".menu").clone().prependTo(".menubox");
No comments:
Post a Comment