Open In App

HTML DOM Input Tel disabled Property

Improve
Improve
Like Article
Like
Save
Share
Report

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

  • It returns the input tel disabled property.  
telObject.disabled;
  • It is used to set the input tel disabled property.  
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. 

HTML




<!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:

tel-disabled

Supported Browsers

  • Google Chrome 3
  • Mozilla Firefox
  • Edge 12
  • Safari 4
  • Opera 11


Last Updated : 14 Jan, 2024
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads