【发布时间】:2013-11-28 00:33:21
【问题描述】:
我有一个表单,它使用 javascript 用一些文本填充文本区域。用户应该能够复制文本,并且我使用下面的代码将 textarea 设为只读。
<textarea readonly id="newList" name="newList" placeholder="When you click
the button below, your list appears here. Copy and paste it into your
new document. Use CTRL-A to quickly select all items."></textarea>
在 Chrome 中效果很好,但在 IE10 中,文本区域仍然不是只读的,当用户单击它时,他们想要复制的文本消失了,取而代之的是光标。它与我的 javascript 无关——我从 HTML 中删除了“脚本”行,这仍然会发生。
有没有一种简单的方法可以在 Internet Explorer 中将 textarea 设为只读?
【问题讨论】:
标签: internet-explorer textarea readonly