If, like you say that Hamas was "democratically" elected by the people of Palestinian Authority, WHO elected Mahmoud Abbas?

Is not Abbas the president?