Move script element from body to head

Move script element from body to head

Hi,
i hope you can help me.

I need to move (or copy) script elements found inside body into head, but i don't understand why my code doesn't do what i supposed.

This is the code i use:

jQuery("body").find("script").each(function(i) {
var x = jQuery(this).clone(true);
jQuery("head").append(jQuery(x));
jQuery(this).parent().remove(jQuery(this));
});