NEW YORK — U.S. stocks are surging Wednesday after President Donald Trump’s party lost its sole control of Washington in the midterm elections. Stocks generally do well in the months following any midterm U.S. election, regardless of who wins, and the S&P 500 soared 1.8 percent toward its best day in three months. The Dow Jones Industrial Average was up 1,112 points, or 2.1 percent, as of 10 a.m. Eastern time, and the Nasdaq composite was 2.4 percent higher. Stocks of solar-power companies helped lead the way as Wall Street tried to sort the winners and losers from the widespread losses for Republicans. Investors, meanwhile, see risks ahead for Trump’s social-media company, the artificial-intelligence industry and businesses owned by Elon Musk, who donated heavily to Republicans. Strategists along Wall Street had been urging investors not to get swept up in the election because it may not matter much for the broad market in the long term. Prices for stocks depend more on where profits for companies and interest rates are heading than on who controls what in Washington. “Earnings