How can I create a scrollable text area which is disabled? By this I mean, I would like the user to be able to scroll to see the 开发者_如何学Gocontents of the text area but not be able to edit it.
I think you need to know the readonly property.
<textarea readonly>blabla<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/></textarea>
Try here : link
Why use a <textarea> if user can't edit it ?
A simple <div> would do the trick with fixed height and overflow:auto;
<textarea readonly="true"></textarea>
just use readonly property
Update:
<textarea readonly>Some text</textarea>
the easiest way would be to use "readonly" instead.
another way would be to use a fixed-height div will overflow:scroll that looks like a textarea but isn't.
加载中,请稍侯......
精彩评论