Input URL readOnly Property - Find out if a URL field is read-only or not: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input URL

Description

Input URL readOnly Property - Find out if a URL field is read-only or not:

Demo Code

ResultView the demo in separate window

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

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {/* w  w  w  . j av  a 2  s.c  om*/
    var x = document.getElementById("myURL").readOnly;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials