use of Jquery .after() for moving an element around
<p>I'm reading the <a href="http://api.jquery.com/after/" rel="nofollow">jquery manual</a> regarding the <code>.after()</code> function:</p>

<pre><code>$('.container').after($('h2'));
</code></pre>

<p>and it says </p>

<blockquote>
  <p>"If an element selected this way is inserted elsewhere, it will be
  moved rather than cloned"</p>
</blockquote>

<p>So if I have multiple 
<code>&lt;div class='before' onclick='afterfunction();'&gt;&lt;div&gt;</code>,</p>

<p>and I would want to place <code>&lt;div class='after'&gt;&lt;/div&gt;</code> after whichever div is clicked (have it move, not clone) would I do something like this?</p>

<pre><code>  var afterdiv = "&lt;div class='after'&gt;&lt;/div&gt;";

  function afterfunction() {
      $(this).after(afterdiv);
       }
</code></pre>

<p>Thanks for all your help!</p>
