Recreate element instead of changing type.

This is necessary since IE does not allow changing the type of the
cloned object.