[cnn-photo-caption image= http://i2.cdn.turner.com/cnn/2008/POLITICS/10/07/presidential.debate/art.handshake.cnn.jpg caption="Sens. Barack Obama and John McCain meet for their second presidential debate."]
(CNN) - Sens. John McCain and Barack Obama went head-to-head on the economy, domestic policy and foreign affairs as they faced off in their second presidential debate.
The debate was set up like a town hall meeting, and the audience was made up of undecided voters.
The candidates spoke directly to each other at times, but at other times they spoke as if their opponent were not in the room.
The debate over foreign policy boiled down to who has the better judgment.
McCain said he knows how to handle foreign affairs and questioned Obama's ability to do so.
"My judgment is something that I think I have a record to stand on," McCain said.
McCain said the "challenge" facing a president considering using military force "is to know when to go in and when not."
Obama questioned McCain's judgment in supporting the invasion of Iraq.
"When Sen. McCain was cheerleading the president to go into Iraq, he suggested it was going to be quick and easy - we would be greeted as liberators. That was the wrong judgment," he said.
Obama vowed to get Osama bin Laden and defeat al Qaeda.
"We will kill bin Laden, we will crush al Qaeda," he said.