<html> <body> <script> addEventListener("hashchange", function () { document.body.style.backgroundColor = "red"; }); </script> </body> </html>