HashChangeEvent: oldURL property - Web APIs | MDN

Value

A string.

Examples

js

window.addEventListener("hashchange", (event) => {
  console.log(`Hash changed from ${event.oldURL}`);
});

Specifications

Specification
HTML
# dom-hashchangeevent-oldurl-dev

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.