1// Event listener
2window.addEventListener("hashchange", e=>console.log('changed'), {});
3// Event handler
4window.onhashchange = e => console.log('changed');
5// HTML event handler
6<body onhashchange="funcRef();">
1window.addEventListener("onhashchange", function(){
2 //url hash # has changed
3});