If you are using bootstrap library's navbar then you may come to a point where you need to automatically set the active page class via class='active' for each page. But if you want this to automatically handled then you can use the following javascript snipt.