iam using jquery and want to do below written
//this is a template
<div class='main'>
<div class='header'>Some Text</div>
<div class='data'>
// data goes here
</div>
</div>
// dom
--------dom here-------------
<div id='red1' class='red'></div>
-----more dom (template is here)------------
what i want is, to bind template to any element(lets say id=red1) to have resulting dom as written below
//below is new dom
--------dom here-------------
<div class='main'>
<div class='header'>Some Text</div>
<div class='data'>
// element is wrapped with template
<div id='red1' class='red'></div>
</div>
</div>
-----more dom (**template is still here**)------------