dom helpers for the browser and node.js