I have a string that for example looks like this.
var html = '<div class="templatemo_post_text grid-85">
<div id="wmd-preview"><h2>Skriv något!</h2>
<p>Lorem ipsum</p></div>
<div class="templatemo_post_footer">
<div class="templatemo_post_on">
<span class="orange">Skrivet den</span> 3 Mar 2013</div>
<div class="templatemo_post_comment">
<a href="#">Inlägg nummer </a>
</div></div></div>';
Can I use the .addClass() in some way to add a class to the id=wmd-preview?
Actually my question goes for all javascripting to modify existing variables. One other thing I would like to do is to replace the whole tag with a new one.
Thanks.