I'm following the top answer to this post here.
Direct link to the JSFiddle.
I tried implemented the same strategy except one part doesn't work, specifically the last line. My structure is a little different so I had to change it.
Original:
 menuItems
  .parent().removeClass("active")
  .end().filter("[href='#"+id+"']").parent().addClass("active");
I had to get rid of parent() because my setup is a little different, but that breaks it.
 menuItems
  .removeClass("active")
  .end().filter("[href='#"+id+"']").addClass("active");
It half works if I keep the first .parent(), it just doesn't remove the class like I'd like it too. So my question is, what is wrong with the syntax of my version, that does not include .parent()?
Here is my HTML structure:
<div class="content-wrap>
  <a class="side-link>Menu item 1</a>
  <a class="side-link>Menu item 2</a>
  <a class="side-link>Menu item 3</a>
</div>
 
    