- Changes the hash value of the location
Location. hash="aaa"</br> will add AAA to the URLCopy the code
- By using the history property in HTML
History. pushState({},'','home') // pushState(data,title, URL) ReplacState ({},'','title') clears the stack and pushes the element to the end of the stack. History. go(int a) This determines the direction of the stack. When negative, the element goes off the stack. History.go (1) is equivalent to history.forward() history.go(-1) is equivalent to historry.. back()Copy the code