More robust way to figure out what DOM object added to the string