Edit This Code:
<!DOCTYPE html>
<html>
<body>

Address:<br>
<textarea id="myTextarea">
342 Alvin Road
Ducksburg</textarea>

<p>Click the button to set the text area to read-only.</p>

<p><b>Tip:</b> Try to write something in the text area before and after you have clicked the button.</p>

<button type="button" onclick="myFunction()">Try it</button>

<script>
function myFunction() {
    document.getElementById("myTextarea").readOnly = "true";
}
</script>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy