On click, replace each paragraph with a jQuery div object that is already in the DOM. Notice it doesn't clone the object but rather moves it to replace the paragraph.
Edit code and click me
Your Result
(Some examples do not work in Google Chrome):
Hello
cruel
World
Replaced!
Edit the code above and click to see the result
www.xhtml.co.il
- Try it yourself