added a helper dom.js function.