Americans have been refining the process since the 1800s election, which originally resulted in an Electoral College tie. The House of Representatives gave Thomas Jefferson the presidency and the first disputed election resulted in the 12th amendment, which changed the Electoral College process.
Later, in 1824, John Quincy Adams arrived at the White House despite not winning either the popular vote or a majority in Electoral College.
In 1876, the results in many Southern states were disputed, and the lack of clear results of the Electoral College led to a House agreement that gave the presidency to Rutherford B. Hayes even though he did not win the Electoral College. or of popular vote. He eventually became the father of the Electoral Count Act of 1887, which is still in force today.
Below is the full timeline.