Yes, create a JavaScript array of changes that you want to make on each level and edit the DOM whenever the level gets completed with the help of that array. May be you could use a counter variable to get incremented whenever one level gets completed, and set that variable as the array index to get the respective change.
Whenever you make these kind of online games, try to have some elements which are going to have some traits that are common say if its a obstacle avoidance game then you may have the walls in common but their arrangements might change according to the level. So I assume that even your game would have such kind of elements. If so then the job is quite simple , you can just alter the specific elements of the page after one level gets completed with the help of JavaScript.
Say Level 1 got completed then you can set a condition whether the user as completed the task or not if yes then with the help of JS create a modal screen that asks them to either to continue or leave, if they choose to continue then don't use a separate HTML file to create the next level just use JS and alter the DOM with some methods like innerHtml
or innerText
.