The HashChangeEvent

DOM Events❮ Event Objects : Events that occur when the anchor part of the URL changes, belongs to the HashChangeEvent Object."

The HashChangeEvent Object

Events that occur when the anchor part of the URL changes, belongs to the HashChangeEvent Object.

HashChangeEvent Properties and Methods

Property/Method Description
newURL Returns the URL of the document, after the hash has been changed
oldURL Returns the URL of the document, before the hash was changed

Inherited Properties and Methods

The HashChangeEvent inherits all the properties and methods from:

Event Types

These event types belongs to the HashChangeEvent Object:

Event Description
onhashchange The event occurs when there has been changes to the anchor part of a URL