unified DOM manipulation functions