title: Console function not defined error?
body: <p>I do not understand why my function isn't working and why I keep getting a "test is not defined error" when I try to run it.</p>
  
  <p>I want the page to scroll down to the appropriate section, when the user clicks the right menu item.</p>
  
  <pre><code>&lt;ul class="timelineNav"&gt;
              &lt;li class="navItem"&gt;
                 &lt;button type="button" onclick='test("1")'&gt;
                     Event1
                 &lt;/button&gt;
              &lt;/li&gt;
              &lt;li class="navItem"&gt;&lt;a class="navItem"    href="url"&gt;Event2&lt;/a&gt;&lt;/li&gt;
              &lt;li class="navItem"&gt;&lt;a class="navItem" href="url"&gt;Event3&lt;/a&gt;&lt;/li&gt;
              &lt;li class="navItem"&gt;&lt;a class="navItem" href="url"&gt;Event4&lt;/a&gt;&lt;/li&gt;
              &lt;li class="navItem"&gt;&lt;a class="navItem" href="url"&gt;Event5&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  
      &lt;article id="post1"&gt; 
              some text
      &lt;/article&gt;
      &lt;article id="post2"&gt; 
              some text
      &lt;/article&gt;
      &lt;article id="post3"&gt; 
              some text
      &lt;/article&gt;
  </code></pre>
  
  <p>Javascript function:</p>
  
  <pre><code>function test(postLocation){
  var post = $('#post'+postLocation).offset();
  $(window).scrollTop(post.top);
  
  };
  </code></pre>
  
  <p>I originally wanted to make the list item itself start the function, but I guess it has to be a button?</p>