Skip to content
Related Articles

Related Articles

SVG Document.scripts Property
  • Last Updated : 03 Nov, 2020

The SVG Document.scripts property returns the list of script element in the document.

Syntax:

var scriptList = document.scripts

Return value: This property returns the list of script element in the document.

Example 1: 

HTML



filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<body>
    <script></script>
    <svg width="700" height="500" 
        xmlns="http://www.w3.org/2000/svg">
        <script>
            console.log(document.scripts);
        </script>
    </svg>
</body>
  
</html>

chevron_right


Output:

Example 2: 

HTML

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<body>
    <script></script>
    <script></script>
    <script></script>
    <script></script>
    <script></script>
    <svg width="700" height="500" 
        xmlns="http://www.w3.org/2000/svg">
        <script>
            console.log(document.scripts);
        </script>
    </svg>
</body>
  
</html>

chevron_right


Output:

full-stack-img

My Personal Notes arrow_drop_up
Recommended Articles
Page :