“javascript current page name” Code Answer var path = window. location. pathname; var page = path. split("/"). pop(); console. log( page );