instrad of appendTo

instrad of appendTo

I am using this function 
  1. (function($){

  2.   $.extend({
  3.     playSound: function(){
  4.       return $("<embed src='"+arguments[0]+"' hidden='true' autostart='true' loop='false' class='playSound'>").appendTo('body');
  5.     }
  6.   });

  7. })(jQuery);


I call this function inside a jquery dialog 

  1. my_dialog = $(modal).dialog({
  2.           buttons: buttonsOpts,
  3.           modal: true,
  4.           title: opts.dialogButton,
  5.  open: function(event, ui) {
  6. $.playSound('notify.wav');
  7.  }
  8.         });
as per the function it appends to body   lot of html.....

once the dialog is closed I want to   delete this appended html .Please advice me how.