Add getElements function for return array of DOM elements