throw an Error if no DOM element is given