How to cut a certain element and paste it at another place on a webpage?

How to cut a certain element and paste it at another place on a webpage?

Assume I have a webpage with the following structure:


  1. <div class="foobar">
  2. ....
  3. <div class="blahblah"> ..... </div>
  4. sometext ....someotherelemens
  5. ...
  6. paste cut element here
  7. </div>


Now I want to cut the element with the class="blahblah" (including its inner content) from its original place

and paste it just before the closing </div> for the element <div class="foobar">


How can I do this with jQuery?


If necessary the operation can be split into two jQuery statements.

However a one-liner is preferred.


Thank you

Peter