There hasn’t been a justice nominated and confirmed in an election year by divided government since 1880.
Since the Civil War, there have been eleven nominations to the Supreme Court in a presidential election year. Of those nine were confirmed, one withdrawn, and one was not acted upon. However, of the nine that were confirmed, eight were with a unified government–that is the President and the Senate were of the same party. Only Justice William Burnham Woods, nominated by Rutherford B. Hayes (a Republican) was confirmed by a Democratic Senate in 1880. All other Justices who were nominated in election year were confirmed by Senates that were of the same party as the President.