SVG Window.crypto Property

Last Updated : 30 Mar, 2022

The SVG Window.crypto property returns the Crypto object associated to the global object.

Syntax:

var cryptoObj = window.crypto

Return value: This property returns the Crypto object associated to the global object.

Example 1:

html
<!DOCTYPE html>
<html>

<body>
    <svg viewBox="0 0 1000 1000" 
        xmlns="http://www.w3.org/2000/svg">
        
        <text x="50" y="20" font-size="20px" 
            onmouseover="check()">
            GeeksForGeeks
        </text>
        
        <script type="text/javascript">
            function check() {
                console.log(window.crypto);
            }
        </script>
    </svg>
</body>

</html>

Output:

Example 2:

html
<!DOCTYPE html>
<html>

<body>
    <svg viewBox="0 0 1000 1000" 
        xmlns="http://www.w3.org/2000/svg">
        
        <circle cx="50" cy="50" r="50" 
            onclick="check()" />
        
        <script type="text/javascript">
            function check() {
                console.log(window.crypto);
            }
        </script>
    </svg>
</body>

</html>

Output:

Comment