Open In App

HTML | DOM HR noshade Property

Improve
Improve
Like Article
Like
Save
Share
Report

The DOM HR noshade property is used to set or return a solid horizontal line instead of shaded lines. It returns a Boolean value.

Note : This property is not supported by HTML5

Syntax: 

  • It returns the HR noshade property.
hrobject.noshade 
  • It sets the HR noshade property.
hrobject.noshade="true/false" 

Property Values:

  • true: It is used to specify the horizontal solid line instead of shadow line.
  • false: It is used to specify a shadow line.

Example 1: This example returns a noshade property. 

HTML




<!DOCTYPE html>
<html>
<head>
    <title>HTML DOM HR noshade property</title>
</head>
<body>
    <h1>GeeksForGeeks</h1>
    <h2>DOM HR noshade Property</h2>
    <p>
        There is a horizontal rule
        below this paragraph.
    </p>
    <!-- Assigning id to 'hr' tag. -->
    <hr id="GFG" align="left" size="10px"
            width="240px" color="red" noshade>
    <p>
        This is a horizontal rule
        above this paragraph.
    </p>
    <button onclick="myGeeks()">Try it</button>
    <h3 id="sudo"></h3>
    <script>
        function myGeeks() {
             
            // return HR noshade property
            var x = document.getElementById("GFG").noShade;
            document.getElementById("sudo").innerHTML = x;
        }
    </script>
</body>
</html>


Output:

  • Before Clicking on Button: 

  • After Clicking on Button:

 

Example 2: This example sets the HR noshade property. 

HTML




<!DOCTYPE html>
<html>
<head>
    <title>HTML DOM HR noshade property</title>
</head>
<body>
    <h1>GeeksForGeeks</h1>
    <h2>DOM HR noshade Property</h2>
    <p>
        There is a horizontal rule
        below this paragraph.
    </p>
    <!-- Assigning id to 'hr' tag. -->
    <hr id="GFG" align="left" size="10px"
            width="240px" color="red" noshade>
    <p>
        This is a horizontal rule
        above this paragraph.
    </p>
    <button onclick="myGeeks()">Try it</button>
    <h3 id="sudo"></h3>
    <script>
        function myGeeks() {
             
            // set HR noshade property
            var x = document.getElementById("GFG").noShade
                            = "false";
             
            document.getElementById("sudo").innerHTML = x;
        }
    </script>
</body>
</html>


Output:

  • Before Clicking on Button:

 

  • After Clicking on Button:

 

Supported Browsers: The browser supported by DOM HR noshade property are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Safari
  • Opera


Last Updated : 24 Aug, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads