How do I use some dom as a template, so something like
<div>
<span> v1 </span>
<span> v2 </span>
<span> v3 </span>
</div>
and then programmatically replace v1-v3 with some values (that i get off an xhr repsonse)
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 can simply store it as a
string, then drop it in a jQuery object whenever you need a new copy.Once it is part of a jQuery object, you can traverse it just like it was already in the DOM, and update its content.
Something like this: http://jsfiddle.net/bZz96/