DRY out element attribute query