Merging of DOM elements