SVG Window.history Property
The SVG Window.history property returns a reference to the History object.
Syntax:
var e = window.history
Return value: This property returns a reference to the History object.
Example 1: In this example we will use onclick event.
<!DOCTYPE html> < html > < body > < center > < h1 >GeeksforGeeks</ h1 > < button onclick = "get()" > Get History </ button > < br >< br > < div id = "g" ></ div > < svg viewBox = "0 0 1000 1000" < script type = "text/javascript" > function get() { console.log(window.history); } </ script > </ svg > </ center > </ body > </ html > |
chevron_right
filter_none
Output:
Example 2: In this example we will use onmouseover event.
<!DOCTYPE html> < html > < body > < center > < h1 >GeeksforGeeks</ h1 > < button onmouseover = "get()" > Get History </ button > < br >< br > < div id = "g" ></ div > < svg viewBox = "0 0 1000 1000" < script type = "text/javascript" > function get() { console.log(window.history); } </ script > </ svg > </ center > </ body > </ html > |
chevron_right
filter_none
Output:
Supported Browsers:
- Google Chrome
- Edge
- Firefox
- Safari
- Opera
- Internet Explorer