Added JS code to change active state on navbar elements on click.