简体   繁体   English

可以使用JavaScript检测浏览器突出显示的拼写错误建议吗?

[英]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.

相关问题 我可以触发浏览器通过javascript显示自动完成建议吗? - Can I trigger the browser to show autocomplete suggestions via javascript? 拼写错误后如何返回上一个提示? - How to return to last prompt after spelling mistake? 比较字符串,如果有小的拼写错误则返回真 - compare string and return true if there is small spelling mistake Android 2.1浏览器Javascript问题和建议 - Android 2.1 Browser Javascript Problems and Suggestions 如何在Intellisense中禁用JavaScript浏览器API建议 - How to disable JavaScript browser API suggestions in Intellisense 有没有办法从 javascript 访问浏览器拼写建议? - Is there a way to access browser spell suggestions from javascript? JavaScript:输出“ NaN”-找不到错误 - JavaScript: output “NaN”- Can't find the mistake 有人可以解释我在这个JavaScript中的错误所在吗? - Can somebody explain where my mistake is in this JavaScript? 在javascript中是否有\ n的替代拼写? - Is there an alternate spelling of \n in javascript? 如何使用JavaScript在浏览器中大致居中显示突出显示的元素? 类似于duckduckgo - How to roughly center the highlighted element in the browser using JavaScript? Similar to duckduckgo
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM