WASHINGTON -- President Barack Obama and Republican challenger Mitt Romney poked gentle but sharp fun at themselves and each other for a charitable cause Thursday night, two days after more serious attacks on each other in their second debate.

The pause for jokes in the tight race for the Nov. 6 election took place at the Alfred E. Smith Memorial Foundation Dinner, organized by the Catholic Archdiocese of New York to benefit needy children.

The two candidates are running neck and neck in the polls and Obama is hoping his strong performance in Tuesday's debate will help him regain the momentum he lost following his poor showing in the first debate two weeks earlier.

The lighthearted evening Thursday was sandwiched between Tuesday's debate and the final one scheduled for Monday night in South Florida.

"I learned there are worse things that can happen to you on your anniversary than forgetting to buy a gift," Obama joked, referring to his poor performance the first time around.

Romney, who spoke before Obama, playfully jabbed at the president, saying both candidates have crucial people on whom they rely. As Romney put it, "I have my beautiful wife, Ann, he's got Bill Clinton."

The event, expected to raise $5 million for Catholic charities, was overseen by Cardinal Timothy M. Dolan, the president of the U.S. Conference of Catholic Bishops, which has clashed with the Obama administration over contraception provisions in the country's new health care law. Dolan has said he received "stacks of mail" protesting the invitation to Obama, but Dolan has sought to avoid playing political favourites. He delivered benedictions at both the Republican and Democratic national conventions this year.

Addressing the elegantly dressed crowd, Romney, a millionaire many times over, said "it's nice to finally relax and wear what Ann and I wear around the house." Of Obama, Romney said: "You have to wonder what he's thinking. So little time, so much to redistribute."

Obama followed. Besides noting his poor performance in the first debate he also chided Romney for his wealth.

"Earlier today I went shopping at some stores in Midtown," Obama said. "I understand Gov. Romney went shopping for some stores in Midtown."

Obama said he has been preparing for the final debate with Romney on Monday, which will focus on foreign policy.

"Spoiler alert: We got bin Laden," Obama said, referring to the military mission that killed the mastermind of the Sept. 11, 2001, terror attacks.

The dinner was Romney's only public event Thursday. But his wife told ABC that her husband's political career will end if he doesn't win this election.

Obama on Thursday campaigned in New Hampshire, one of a handful of closely fought "battleground" states in the election, before warming up for his dinner speech with an appearance on Comedy Central's "The Daily Show."

Since the presidency is not decided by a nationwide popular vote but in state-by-state contests, states like New Hampshire that do not reliably vote Republican or Democratic are overwhelmingly important in a tight race like this one.

The two candidates have turned their attention to undecided female voters.

Romney's campaign aired a television commercial that seemed designed to soften his opposition to abortion while urging women to keep economic issues topmost in their minds when they vote.

Obama's campaign responded with an ad featuring video of Romney in an earlier debate against fellow Republicans saying he would "be delighted" to sign a bill banning all abortions as president.

Obama also picked up the endorsement of rock star Bruce Springsteen, who also backed him in 2008. Springsteen campaigned for Obama on Thursday in Ohio with former President Bill Clinton.