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
- 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
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:
Supported Browsers
- Google Chrome 3
- Mozilla Firefox
- Edge 12
- Safari 4
- Opera 11
Last Updated :
14 Jan, 2024
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...