title: Add/Delete class to <li> with Javascript when you are on specific div.
body: <p>I open this thread to ask your help with JavaScript.</p>
  
  <p>My website is divided vertically into four main div.</p>
  
  <pre><code>&lt;div id="homepage"&gt; Content &lt;/ div&gt;
  &lt;div id="page1"&gt; Content &lt;/ div&gt;
  &lt;div id="page2"&gt; Content &lt;/ div&gt;
  &lt;div id="page3"&gt; Content &lt;/ div&gt;
  &lt;div id="page4"&gt; Content &lt;/ div&gt;
  </code></pre>
  
  <p>On the right of page there is navigation menu, div position: fixed.</p>
  
  <pre><code>&lt;div id="nav"&gt;
  &lt;ul&gt;
  &lt;li&gt; &lt;a href="#homepage"&gt; Homepage &lt;/ a&gt; &lt;/ li&gt;
  &lt;li&gt; &lt;a href="#page1"&gt; Page1 &lt;/ a&gt; &lt;/ li&gt;
  &lt;li&gt; &lt;a href="#page2"&gt; Page2 &lt;/ a&gt; &lt;/ li&gt;
  &lt;li&gt; &lt;a href="#page3"&gt; Page3 &lt;/ a&gt; &lt;/ li&gt;
  &lt;li&gt; &lt;a href="#page4"&gt; page4 &lt;/ a&gt; &lt;/ li&gt;
  &lt;/ ul&gt;
  &lt;/ div&gt;
  </code></pre>
  
  <p>I wish that when you are in a div container (page1 or page2 etc) is added to a class corresponding menu item.</p>
  
  <p>And 'possible to do this with javascript?
  Thanks in advance</p>