Don P
Don P

Reputation: 63728

Textarea without input functionality

I am making an application with text-chat. I want to display the text output, but don't want to custom code an entire div, with a scroll bar, etc.

<textarea> seems to behave really nice for accepting text input. How can I disable inputting new values?

Upvotes: 1

Views: 4014

Answers (1)

Musa
Musa

Reputation: 97717

To prevent input in a textarea add the readonly attribute to it

<textarea readonly></textarea>

Upvotes: 3

Related Questions