<html>
<body>
Name: <input type="text" id="myText" readonly>
<p>Click the button to find out whether the text field is read-only, or not.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myText").readOnly;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_text_readonly by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 18:16:56 GMT -->
</html>