Disabling Firefox and Chrome spell checking in iframe-based text editors

ぃ、小莉子 提交于 2019-12-20 05:23:39

问题


There is a lot of info around about how to disable spell checking in html textarea element by using spellcheck='false'. However to have text area with more advanced capabilities, one must use iframe with designMode = "on" (see e.g. this page, this is a way that RichTextArea is implemented in GWT) and I couldn't find a single post on that topic.

It turns out that Firefox detects such advanced text areas and enables its spell checking in them. You can see it live by visiting this page from Firefox/Chrome and entering some content to text field. If you inspect html source code with e.g. Firebug, you'll see no textarea tag, yet FF spell checking is still active. The only way I managed to disable it was setting designMode to off but... I need it to be on.

The question is: Is there any possibility to disable FF spell checking for iframe-based text areas, without setting designMode = "off"?


回答1:


Just set spellcheck="false" onto the body element in the iframe. Works here in FF.



来源:https://stackoverflow.com/questions/12391766/disabling-firefox-and-chrome-spell-checking-in-iframe-based-text-editors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!