Copy attributes (e.g. classes) from the new head and html elements to the old one