If it's not in the DOM, then all you have to do is clear any JS references to it and the garbage collector will remove it for you. This is essentially no different than a javascript object or a javascript array. If you clear any references to it, the garbage collector will clean it up.
So, if you create it like this:
var paragraphElement = document.createElement('p');
Then, all you have to do to get rid of it is clear that reference:
var paragraphElement = null;
With no javascript references to the element, the garbage collector will remove it.