有没有办法从JavaScript访问浏览器咒语建议?

发布于 2025-02-12 12:16:32 字数 148 浏览 0 评论 0原文

我正在尝试在我的网站上制作一个搜索栏,该搜索栏在数据库中搜索某个句子,我希望能够在提交之前纠正表单输入的拼写。我注意到输入中有拼写错误的单词时,有一条红色的线条,当您右键单击时,它显示了建议。有没有访问这些建议的API?我尝试了不同的JavaScript库,但没有一个有准确的建议。

I am trying to make a search bar in my website which searches for a certain sentence in the database, I want to be able to correct the spelling of the form input before submitting it. I've noticed that there's a red squiggly line when there's a misspelled word in the input and when you right click it show's suggestions. Is there any API to access these suggestions? I've tried different javascript libraries and none of them have accurate suggestions.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最后的乘客 2025-02-19 12:16:32

看来没有办法。您必须自己使用库的拼写检查器。

我发现此堆栈溢出答案: https://stackoverflow.com/a/32657649/15920018

据我所知,您不能

It appears that there isn't a way. You have to either make a spellchecker yourself of use a library.

I found this stack overflow answer: https://stackoverflow.com/a/32657649/15920018

To the best of my knowledge, you cannot.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文