Donald Trump was elected president after a campaign during which he frequently said that various officials, including Nancy Pelosi and Joe Biden, should be prosecuted and punished for wrongdoing.