Why does my click handler fail after 2 clicks?
<p>My aim is to toggle between two images up and down. </p>

<p>This is what i have, and it works partially. </p>

<p>If this is OK then what am i missing?<br>
When i click two times it stops working....</p>

<p>Here is my code:</p>

<pre><code>   $(document).ready(function () {
       $(".collapse").click(function () {
           $("#box").hide();
           $(".collapse").replaceWith('&lt;span class="open"&gt;&lt;/span&gt;');
           $(".open").click(function () {
               $("#box").show();
               $(".open").replaceWith('&lt;span class="collapse"&gt;&lt;/span&gt;');
           });
       });
   });
</code></pre>
