JavaScript :: Find the element before and after a specific element
===

Having a list with links like this:

    <ul>
        <li><a href="#">First tab</a></li>
        <li><a href="#">Second tab</a></li>
        <li class="active"><a href="#">Active tab</a></li>
        <li><a href="#">Fourth tab</a></li>
        <li><a href="#">Fifth tab</a></li>
    </ul>

How can be found element before and after the active tab? (In this case, the second and fourth tab).

---

I am looking for solution in **pure JavaScript** only, as jQuery solution is [here][1].


  [1]: http://stackoverflow.com/questions/929670/find-the-element-before-and-after-a-specific-element