Class and ID .replaceWith and .live listener issues
<p>I'm listening with .live for a 'click' on a link (using class) hoping it bubbles up, then .replaceWith to exchange a div (using ID) with a new var ..</p>

<pre><code>&lt;script type="text/javascript"&gt;

$(document).load(function(){
  $('a.caption').live('click', function() { &lt;!-- '.caption' or 'caption', I've also tried ID '#caption' and 'div#caption' --&gt;

    var video = $('&lt;div height=""&gt;&lt;/div&gt;');

    $('div#slider-wrapper').replaceWith(video);
  });
});
</code></pre>

<p></p>

<pre><code>&lt;div id="slider-wrapper"&gt;

  &lt;div id="slider" class="nivoSlider"&gt;

       &lt;img src="image.jpg" alt="" title="#caption1" /&gt;

  &lt;/div&gt;

  &lt;div id="caption1" class="nivo-html-caption"&gt;Stuff&lt;/br&gt;
     &lt;a class="caption" href=""&gt;where the click happens &lt;!-- this is where I suspect a problem with class, or above with slider-wrapper div--&gt;
     &lt;/a&gt;
  &lt;/div&gt;

&lt;/div&gt; &lt;!--slider wrapper end --&gt;
</code></pre>

<p>I've tried variations of class, and ID's. Also both class, and both ID. I've read that class is recommended depending on what you need. I've also evaluated .click and seems that .live 'click' is the right way to listen in my situation.</p>

<p>I've checked answers for some time, adjusting my code incrementally. I suspect it's simple selector use, and my post here is a last resort.</p>

<p>Thank you in advance for considering this simple problem.</p>
