Skip to content
Related Articles
Open in App
Not now

Related Articles

HTML | DOM isId Property

Improve Article
Save Article
Like Article
  • Last Updated : 11 Aug, 2021
Improve Article
Save Article
Like Article

The isId Property contains a boolean value which 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. 


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


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

Before clicking the submit button: 

After clicking the submit button: 

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

My Personal Notes arrow_drop_up
Like Article
Save Article
Related Articles

Start Your Coding Journey Now!