xxxxxxxxxx
// Access and manipulate the hash of the current URL
console.log(location.hash);
// Set a new hash value
location.hash = "#newhash";
// Listen for changes in the hash value
window.addEventListener("hashchange", function() {
console.log("Hash changed:", location.hash);
});