Open In App

HTML DOM isId Property

Last Updated : 12 Jun, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

The isId Property contains a boolean value that returns a true if the Element has an attribute type of ID, otherwise, it returns a false or undefined value. This Property is used for read-only. 

Syntax: 

attribute.isId 

Return Value: It returns a Boolean value i.e. true if the attribute type is ID, else it returns a false. 

Example: In this example, we will use isId Property.

html




<!DOCTYPE html>
<html>
<head>
    <title>
          DOM isID property
      </title>
</head>
<body>
    <center>
        <h1 style="color:green;">GeeksforGeeks</h1>
        <h2> DOM isId Property</h2>
        <button onclick="geeks()">Submit</button>
        <p id="sudo"></p>
        <script>
            function geeks() {
                let x = document.getElementById("sudo");
                x.innerHTML = x.attributes[0].isId;
            }
        </script>
    </center>
</body>
</html>


Output: 

 

Supported Browser: No major browser support the DOM isID property.


Previous Article
Next Article

Similar Reads

PHP | DOMAttr isId() Function
The DOMAttr::isId() function is an inbuilt function in PHP which is used to check if an attribute is a defined ID or not. According to the DOM standard, it requires the attribute ID to be of type ID. You need to validate your document with DOMDocument::validateOnParse() method before using this function. Syntax: bool DOMAttr::isId( void ) Parameter
2 min read
HTML DOM lang Property
In HTML document, the lang property is used to set or return the value of the lang attribute of an element. This attribute specifies the language code of the element's content. The element attribute takes "en" for English, "ja" for Japanese, "es" for Spanish, and so on. The default value of this attribute is unknown. Syntax: Get the value of lang:
2 min read
HTML DOM Style backgroundClip Property
The DOM style backgroundClip Property is used to set or return the painting area of the background. Syntax: It is used to return the backgroundClip property.object.style.backgroundClip It is used to set the backgroundClip property. object.style.backgroundClip = "border-box|padding-box|content-box|initial|inherit" Property Values: border-box propert
1 min read
HTML DOM Style borderTop Property
The DOM style borderTop property is used to set or return the three different border-top property such as border-top-width, border-top-style, and border-top-color of an element. Syntax: It returns the borderTop property. object.style.borderTopIt is used to set the borderTop property. object.style.borderTop = "width style color|initial|inherit" Prop
2 min read
HTML | DOM Meter max Property
The DOM Meter max Property is used to set or return the value of the max attribute of a gauge. The max attribute is used to specify the upper bound of the gauge and the value of the max attribute must be greater than the value of the min attribute. It has a default value which is 1. Syntax: It return the max property.meterObject.maxIt is used to se
2 min read
HTML | DOM Input Hidden value Property
The Input Hidden value property in HTML DOM is used to set or return the value of the value attribute of the hidden input field. The value attribute defines the default value of the input hidden field. Syntax: It returns the value property.hiddenObject.valueIt is used to set the value property.hiddenObject.value = text Property Values: This propert
2 min read
HTML DOM Marquee direction Property
The marquee direction property in HTML DOM is used to set or return the value of the direction attribute of the &lt;marquee&gt; tag. Syntax: It is used to return the marquee direction property. marqueeObject.direction; It is used to set the marquee direction property. marqueeObject.direction = "up|down|left|right" Note: This property is depreciated
2 min read
HTML | DOM Textarea autofocus Property
The DOM Textarea autofocus Property is used to set or return whether the element should get focus when the page loads. This property is used to reflect the HTML autofocus attribute. Syntax: It is used to Return the autofocus property. textareaObject.autofocusIt is used to Set the autofocus property. textareaObject.autofocus = true|false Property Va
2 min read
HTML | DOM Style columnGap Property
The DOM Style columnGap property specifies the gap between the columns. Syntax : For return the value: object.style.columnGap For set the value: object.style.columnGap = "length|normal|initial|inherit" Property Values: length: Set the column gap in length unit. normal: The default value of column gap. initial: Sets the default value. inherit: Inher
4 min read
HTML | DOM Input Time autofocus Property
The DOM Input Time autofocus Property in HTML DOM is used to set or return whether the time field should automatically get focus or not when the page loads. This Property is used to reflect the HTML autofocus attribute. Syntax: It returns an autofocus Property. timeObject.autofocus It is used to set the autofocus property. timeObject.autofocus = tr
2 min read