added useful functions to set attributes and select elements by attributes