SyntaxFix
Write A Post
Hire A Developer
Questions
For Bootstrap v4.3.1. Try below:
$(document).ready(function() { var pathname = window.location.pathname; //get the path of current page $('.navbar-nav > li > a[href="'+pathname+'"]').parent().addClass('active'); })