title: How to know what function (or code snippet) is triggered when an event happens?
body: <p>I learn HTML and CSS by looking at the code on browsers with Firebug tool. If I can't understand what they do, I look up their reference. And I learned a lot.</p>
  
  <p>Now I want to learn JavaScript in the same way (I just know  a litle bit about JS). Let's say:</p>
  
  <ol>
  <li>I open a web page (e.g Facebook)</li>
  <li>I click on setting button on the top right of the page. It shows a list of options (Account Setting, Privacy Settings, Log Out, ...)</li>
  <li>I know the options box is an <code>&lt;ul&gt;</code> tag, and it will toggle show/hide when I click on the setting button.</li>
  </ol>
  
  <p>As far as I know, if I want to test a JS snippet (using Firebug), I have to know at what point it should run through. But I am not a Facebook developer, I didn't write that code, so I can't guess that point.</p>
  
  <p>How can I know what function is called to show the "options box" when I "click" on setting button?</p>