HTML onhashchange event Attribute

❮ HTML Event Attributes

Example

<body onhashchange="myFunction()">

Meaning

The onhashchange attribute fires when the URL’s hash identifier value changes.

Changing this value is commonly performed in Ajax applications to indicate a state change and support browser back-button activity.


Standard Syntax

<element onhashchange="script">

Browser Support




Status







Attribute Values

Value Description
script Specifies the script to be run on onhashchange



Technical Details

Supported HTML elements:

<body>
❮ HTML Event Attributes