Switch Active Class For Nav Links in jQuery

In case of single page website navigation, we want to navigate to different sections of page by clicking navigation links. Because its a one page website, we do not want the links to change url in address bar. Also the links should change their state to active on click. In this tutorial we had a website with header navigation to scroll to sections of same page but our links were not indicating the current location of attention. So we are applying a simple method to change classes when a link is being clicked to enhance accessibility o webpage and overall user experience.