Open In App

SVG Window.crypto Property

Last Updated : 30 Mar, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

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:




<!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:




<!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:



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads