Added ability to specify DOM elements