Код: Выделить всё
Foo
function main() {
const button = document.getElementById('button')
button.addEventListener('click', navigate)
}
let count = 0
function navigate() {
window.history.replaceState(null, '', '#' + count)
count++
}
window.addEventListener('load', main)
Click me
Подробнее здесь: https://stackoverflow.com/questions/797 ... -history-e
Мобильная версия