Simple javascript/jquery append, remove question
<p>Hey guys, quick question. I have a div that on click will execute a jquery function onclick, and then replace the div with its opposite div which onclick will replace back to the first div <strong>just like the favorite function on this site</strong>. I am having a simple problem I hope someone can spot or explain to me it is not possible. The function works with the initial two divs that are served directly, but when I click on either of the original two divs, and the function executes and replaces the div with the corresponding div the replacement div does not execute the function. I have to refresh the page to get the original div, which is identical to execute the function. Is the div actually replaced on the page with append, or does it just visually show it? Any advice appreciated.</p>

<p>original div </p>

<pre><code>&lt;div class="unfavorite"&gt;&lt;img id="unfavorite_img" src="images/favorite2.png" /&gt;&lt;/div&gt;
</code></pre>

<p>javascript div replacement</p>

<pre><code> $(".favorite").remove();
 $(".favoriteholder").append('&lt;div class="unfavorite"&gt;&lt;img id="unfavorite_img" src="images/favorite2.png" /&gt;&lt;/div&gt;');
</code></pre>
