When the window’s history change, the onpopstate event triggers. You can add it like this −
Example
<!DOCTYPE html> <html> <body onpopstate = "onpopstateFunction()"> <p>This is demo text</p> </body> </html>
When the window’s history change, the onpopstate event triggers. You can add it like this −
<!DOCTYPE html> <html> <body onpopstate = "onpopstateFunction()"> <p>This is demo text</p> </body> </html>