I just need to disable typing any text into text-area, I want to use text-area just for showing text. I am making a chat web-site.
您可以添加readonly
<textarea cols="30" rows="10" readonly>Lorem ipsum dolor.</textarea>
Use disabled attribute for this
You can style this in CSS
Or If you want only to show text use div
or span
not textarea
对于使用以下语法的Angular
应用程序,它将不允许任何pointer events
但是我们可以scroll
上下文
<textarea cols="30" rows="10" [readonly]="true/false">{{info}}</textarea>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.