Returning parent before children in getElementsByAttr

Same as in getElementsByType, makes selectors easier to use.