Open In App

HTML DOM Input Tel disabled Property

The DOM input tel disabled Property is used to set or return whether the input tel field must be disabled or not. A disabled tel field is un-clickable and unusable. It is a boolean attribute that reflects the disabled attribute. It is usually rendered in grey color by default in all the browsers. 

Syntax

telObject.disabled;
telObject.disabled = true|false

Property Values

Property Values

Descriptions

true

It defines that the input tel field is disabled.

false

It has a default value. It defines that the input tel field is not disabled. 

Return Value

It returns a boolean value that represents whether the input tel field is disabled or not. 



Example: This example illustrates how to return the disabled property. 




<!DOCTYPE html>
<html>
 
<head>
    <title>
        HTML DOM Input Tel disabled Property
    </title>
</head>
 
<body style="text-align:center;">
    <h1>GeeksforGeeks</h1>
 
    <h2>HTML DOM Input Tel disabled Property</h2>
 
    <input type="tel"
           id="mytel"
           value="6753682635" disabled>
 
    <p>
        Click on button to check whether the
        input tel field is disabled or not
    </p>
 
    <button onclick="myFunction()">
        Click Here!
    </button>
 
    <p id="result"></p>
 
    <script>
        function myFunction() {
 
            // Accessing input tel field
            let x = document.getElementById("mytel").disabled;
            document.getElementById("result").innerHTML = x;
        }
    </script>
</body>
 
</html>

Output:



Supported Browsers


Article Tags :