[英]Can browser highlighted spelling mistake suggestions be detected with JavaScript?
If you type a spelling mistake in a textarea, most browsers will alert you by highlighting the word somehow, for example, underlining it in red. 如果您在textarea中键入拼写错误,大多数浏览器会以某种方式突出显示该单词来提醒您,例如,用红色加下划线。 Is this style change visible to JavaScript? 这种样式更改对JavaScript可见吗? If so, how? 如果是这样,怎么样?
It is not. 它不是。 As far as I know, browsers do not add this functionality to javascript. 据我所知,浏览器不会将此功能添加到javascript。 Even if they did it would probably be highly variable from browser to browser, especially mobile browser. 即使他们这样做,从浏览器到浏览器,特别是移动浏览器,也可能是高度可变的。 It's possible that the spell correction could be part of the Web Browser Framework, rather than the DOM. 拼写纠正可能是Web浏览器框架的一部分,而不是DOM。 It is, in fact, possible to disable spell check on text fields and then implement your own in its place. 事实上,可以对文本字段禁用拼写检查,然后在其位置实现自己的拼写检查。 I know a lot of embedded code editors do this. 我知道很多嵌入式代码编辑都会这样做。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.