Related Articles

Related Articles

SVG Window.history Property
  • Last Updated : 20 Nov, 2020

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.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!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" 
            xmlns="http://www.w3.org/2000/svg">
              
            <script type="text/javascript">
                function get() {
                    console.log(window.history);
                }
            </script>
        </svg>
    </center>
</body>
  
</html>

chevron_right


Output:



Example 2: In this example we will use onmouseover event.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!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" 
            xmlns="http://www.w3.org/2000/svg">
              
            <script type="text/javascript">
                function get() {
                    console.log(window.history);
                }
            </script>
        </svg>
    </center>
</body>
  
</html>

chevron_right


Output:

Supported Browsers:

  • Google Chrome
  • Edge
  • Firefox
  • Safari
  • Opera
  • Internet Explorer

 

full-stack-img




My Personal Notes arrow_drop_up
Recommended Articles
Page :