Hitler himself was never elected by the people. He lost the presidential election but the Nazis formed a coalition that got them enough seats to demand the position of Chancellor for Hitler.