Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

SVG Event.isTrusted Property

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

The SVG Event.isTrusted property is a boolean that is true when the event was generated by a user action.

Syntax:

var eventIsTrusted = event.isTrusted

Return value: This property returns the boolean value of the event element.

Example 1: In this example, we will use onclick event.




<!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(event)" />
          
        <script type="text/javascript">
            function check(event) {
                document.write(
                    "This Event is Trusted : ", 
                    event.isTrusted);
            }
        </script>
    </svg>
</body>
  
</html>

Output:

Example 2: In this example, we will use onclick event.




<!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" 
            onclick="check(event)">
            GeeksForGeeks
        </text>
          
        <script type="text/javascript">
            function check(event) {
                document.write(
                    "This Event is Trusted : ", 
                    event.isTrusted);
            }
        </script>
    </svg>
</body>
  
</html>

Output:

Example 3: In this example, we will use onmouseover event.




<!DOCTYPE html>
<html>
  
<body>
    <svg viewBox="0 0 1000 1000" 
        xmlns="http://www.w3.org/2000/svg">
          
        <circle cx="50" cy="50" r="50" 
            onmouseover="check(event)" />
          
        <script type="text/javascript">
            function check(event) {
                document.write(
                    "This Event is Trusted : ", 
                    event.isTrusted);
            }
        </script>
    </svg>
</body>
  
</html>

Output:

Example 4: In this example, we will use onmouseover event.




<!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(event)">
            GeeksForGeeks
        </text>
          
        <script type="text/javascript">
            function check(event) {
                document.write(
                    "This Event is Trusted : ", 
                    event.isTrusted);
            }
        </script>
    </svg>
</body>
  
</html>

Output:


My Personal Notes arrow_drop_up
Last Updated : 31 Mar, 2022
Like Article
Save Article
Similar Reads
Related Tutorials