Skip to content
Related Articles

Related Articles

Improve Article

HTML | DOM Link sizes Property

  • Difficulty Level : Basic
  • Last Updated : 22 Apr, 2019

The HTML | DOM Link sizes Property is used For returning the value of the sizes attribute of a linked document. The sizes attribute is used to specify the sizes of the icon for visual media and it only works when rel=”icon”. It is read-only Property.

Syntax:

linkObject.sizes

Return Value: It returns the size of the icon.

Example: This Example returns the sizes Property.




<!DOCTYPE html>
<html>
  
<head>
    <link id="linkid"
          rel="stylesheet" 
          type="text/css" 
          href="styles.css" 
          sizes="16*16">
</head>
  
<body style="text-align:center;">
    <h1>GeeksForGeeks</h1>
    <h2>DOM Link sizes Property</h2>
  
    <button onclick="gfg()">Get URL
    </button>
  
    <p id="pid" 
       style="font-size:25px;color:green;">
  </p>
  
    <script>
        function gfg() {
  
            // Access link element. 
            var NEW = document.getElementById(
                "linkid").sizes;
            document.getElementById(
                "pid").innerHTML = NEW;
        }
    </script>
  
</body>
  
</html>

Output: :
Before Clicking On Button:

After Clicking On Button:

Supported Browsers:

  • Google Chrome
  • Mozilla Firefox
  • Edge
  • Safari
  • Opera

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.




My Personal Notes arrow_drop_up
Recommended Articles
Page :