HashChangeEvent: HashChangeEvent() constructor
The HashChangeEvent() constructor creates a new HashChangeEvent object, that is used by the hashchange event fired at the window object when the fragment of the URL changes.
Note: A web developer doesn't typically need to call this constructor, as the browser creates these objects itself when firing hashchange events.
Syntax
js
new HashChangeEvent(type, options)
Parameters
Return value
A new HashChangeEvent object.
Specifications
| Specification |
|---|
| HTML Standard # the-hashchangeevent-interface |
Browser compatibility
| desktop | mobile | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
HashChangeEvent() constructor | |||||||||||
See also
hashchangeevent