title: How do I find out what javascript runs when I click an element?
body: <p>I am looking at the <strong>Bing Maps</strong> site. I am opening up the <strong>my places editor</strong> and clicking the <strong>polyline tool</strong> in the drawing toolbar.</p>
  
  <p>I would like to discover what javascript runs when I click on tools in the drawing toolbar.</p>
  
  <p>I have looked at the html and there is no <code>onclick</code> event declared on the element.</p>
  
  <p>I have done text searches on all of the scripts referenced by the page, for the ID of the polyline tool element. This was to try to find javascript that attaches a click event to the element, but I got no matches at all.</p>
  
  <p>There must be some script running when I click on a tool. How do I find out what script is executing when I click the tool divs in the toolbar?</p>
  
  <p>I don't think there is anyway I can set breakpoints if I don't first know what script to set them on. Is there anyway I can trap the javascript that runs to discover what it is, either in IE F12 developer tools or in firebug?</p>