I have a series of HTML files in the same directory named: page1.html, page2.html, page3.html, etc. I can identify the name of my current HTML document like this:
var path = window.location.pathname; var page = path.split("/").pop(); console.log( page );
But now I want to be able to log the next HTML file in the series. So if I am on page2.html, I want to log page3.html. How can I replace that file name, with the next numbered file in my series ?