Maybe Firebug or Opera, Google Chrome tools allows it. Where to find it? how to use?
Example: I click the button and want to see what Javascript code fired up after that action.
In Google Chrome, you can open Developer Tools (Ctrl+Shift+J)
Choose Profiles tab, choose Collect JavaScript CPU Profile, click Start
When finish, click Stop and see the progress log...
you can include firebug lite in your html .. that will enable you to debug javascript ..you can get it from here : http://getfirebug.com/firebuglite