I need to do a copy of html inside one div to another div such that it shows the latest html content at any time. The content in duplicate div should change when original is changed.
I’m using jquery. How do I do that ?
EDIT:
Need to do that live.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could do the bruteforce method by polling the content of the first div and copy it if it changed:
html:
js:
this checks every second.
If you have a callback or event when you know the content of div1 changed, then you could copy the content only then. This would be more efficient of course.