HashChangeEvent newURL Property in JavaScript
HashChangeEvent newURL Property in JavaScript
The newURL property is a read-only property and is used to return URL of the document after hash i.e, anchor part has been changed. It contains the URL to which we navigated. For getting the URL from which we navigated away, we use the oldURL property.
Syntax:-
Its syntax is:- event.newURL
Return:-
Its return is:- a string containing URL that was navigated to