Disabled scrollable text

How to create a scrollable text area that is disabled? By this, I mean that I would like the user to be able to scroll to see the contents of the text area, but not be able to edit it.

+6
html
source share
4 answers

Why use <textarea> if the user cannot edit it?

A simple <div> will do the fixed-height trick and overflow:auto;

+8
source share

I think you need to know the readonly property.

Try it here: link

+9
source share
 <textarea readonly="true"></textarea> 

just use readonly property

Update:

 <textarea readonly>Some text</textarea> 
+6
source share

The easiest way is to use readonly instead.

another way would be to use a fixed-height div overflow:scroll , which looks like a text box, but it is not.

+2
source share

All Articles