In the following web example we have a list with id list, two buttons to copy and replace and a div with id show.
- We select the button with id copy, when clicked we get the html content of the list, then we select the div with id show and add that html content.
- We select the button with id replace, when clicking we generate a function that selects the list and replaces the old html content with a new one.