HTML DOM Input URL disabled Property

HTMLWeb DevelopmentFront End Technology

The HTML DOM Input URL disabled property sets/returns whether Input URL is enabled or disabled.

Syntax

Following is the syntax −

  • Returning boolean value - true/false
inputURLObject.disabled
  • Setting disabled to booleanValue
inputURLObject.disabled = booleanValue

Boolean Values

Here, “booleanValue” can be the following −

booleanValueDetails
TrueIt defines that the input url is disabled.
FalseIt defines that the input url is not disabled and it is also the default value.

Example

Let us see an example of Input URL disabled property −

 Live Demo

<!DOCTYPE html>
<html>
<head>
<title>Input Email disabled</title>
<style>
   form {
      width:70%;
      margin: 0 auto;
      text-align: center;
   }
   * {
      padding: 2px;
      margin:5px;
   }
   input[type="button"] {
      border-radius: 10px;
   }
</style>
</head>
<body>
<form>
<fieldset>
<legend>Email-disabled</legend>
<label for="EmailSelect">Employee Email :
<input type="email" id="EmailSelect" value="xyz@abc.com">
</label>
<input type="button" onclick="getdisabled()" value="Confirm Email">
<div id="divDisplay"></div>
</fieldset>
</form>
<script>
   var divDisplay = document.getElementById("divDisplay");
   var inputEmail = document.getElementById("EmailSelect");
   function getdisabled() {
      inputEmail.disabled = true;
      divDisplay.textContent = 'Email: '+inputEmail.value+' submitted.';
   }
</script>
</body>
</html>

Output

This will produce the following output −

Before clicking ‘Confirm Answer’ button −

After clicking ‘Confirm Answer’ button −

raja
Published on 26-Jul-2019 12:05:12
Advertisements