title: Javascript/jQuery - On hover over a li element, change class of another li element
body: <p>i am having some trouble with the menu bar on this website: <a href="http://www.re-generation.ro/ro/campanii/minerit-aurifer" rel="nofollow">http://www.re-generation.ro/ro/campanii/minerit-aurifer</a> .
  Now, the second <code>li</code> element is active. What i want to do, is that on <code>hover</code> over any other <code>li</code> element in the menu, the <code>class</code> of the current active <code>li</code> element becomes blank and on on hover out, it becomes active again. If you visit the link you can easily understand what i what.</p>
  
  <p>If you need any information pls ask.</p>
  
  <p>thank you in advance!</p>
  
  <p>My code:</p>
  
  <pre><code>var lis = document.getElementsByTagName('ul'); 
  for (var i=0, len=lis.length; i&lt;len; i++){ 
      lis[i].onmouseover = function(){ 
          var firstDiv = this.getElementsByTagName('li')[1]; 
          firstDiv.className = ''; 
          var ul = $(this).parent(document.this.getElementsByTagName('ul')[1]); 
          ul.className = ''; 
      }; 
      lis[i].onmouseout = function(){ 
          var firstDiv = this.getElementsByTagName('li')[1]; 
          firstDiv.className = 'active'; 
      }; 
  };
  </code></pre>
  
  <p>EDIT: Thank you all for your answers! That really helped! </p>