Input URL disabled Property - Disable and enable a URL field: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input URL

Description

Input URL disabled Property - Disable and enable a URL field:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>
Homepage: <input type="url" id="myURL"><br><br>

<button onclick="disableBtn()">Disable URL Field</button>
<button onclick="enableBtn()">Enable URL Field</button>

<script>
function disableBtn() {//from   w w w. jav  a2 s.  c o m
    document.getElementById("myURL").disabled = true;
}
function enableBtn() {
    document.getElementById("myURL").disabled = false;
}
</script>

</body>
</html>

Related Tutorials