Here are 2 ways:
1. put in the 'debugger' statement. When the browser reaches this statement,
it will pop up a message box asking if you want to debug. You can then
select a new or existing instance of VS and go from there. You must have
debugging enabled in your browser and specify that you want to be notified
of every script error, or else you won't get this pop up.
2. Attach to the iexplorer.exe process that is running your page using VS.
You should be able to set breakpoints, etc.
However, as an aside, method 2 though this does sometimes work for me,
sometimes it does not. It seems to be sort of flaky, and sometimes it just
won't stop at the breakpoints. #1 is pretty reliable, but you have to
remember to remove the debugger statements when you are done