JSFiddle - React, Tailwind, and code Playground
by gentou
HTML
<button id="button">ssssssss</button>
<div class="red"></div>
CSS
div{
height: 100px;
width: 100px;
background-color: red;
}
JavaScript
window.addEventListener('hashchange', function() {
console.log("changed");
console.log(location.hash);
if(location.hash == "#qwe"){
history.pushState('', document.title, window.location.pathname);
location.hash = "";
}
}, false);
var button = document.getElementById("button");
button.addEventListener("click", function(){
window.location.hash = "qwe";
});