【问题标题】:HTML5 spellcheck - any way to determine if a any misspelled words have been foundHTML5 拼写检查 - 确定是否找到任何拼写错误的单词的任何方法
【发布时间】:2014-03-29 01:12:45
【问题描述】:

我想使用 HTML5 拼写检查属性来检查输入的拼写错误。如果用户尝试使用拼写错误提交,则使用 angularJS 会显示警报。有什么方法可以访问某个状态,说明是否在文本块中发现了拼写错误。

【问题讨论】:

标签: html angularjs spell-checking


【解决方案1】:

您可以使用这个 javaScript 插件: https://www.javascriptspellcheck.com/

要使用它,您只需解压缩并引用它。它还在他们的网站上有一个“Hello World”教程和详细记录的方法。

提供的工作示例代码如下:

<script type='text/javascript' src='/JavaScriptSpellCheck/include.js' ></script>
<script type='text/javascript'>$Spelling.SpellCheckAsYouType('myTextArea')</script>
<textarea name="myTextArea"  id="myTextArea" cols="30" rows="4" style = 'max-width:500px;width:100%;height:200px;margin-bottom:20px'>
        This this is a simple exampl of Spell-checking As-You-Type using javascript spellcheck.
        It works in almost any browser, and supports upto 24 international languages.
        The button bellow shows an alternative way to spellcheck using javascript spellcheck - using a dialog iwndow!
</textarea>
<input type="button" value="Spell Check in a Dialog" onclick="$Spelling.SpellCheckInWindow('myTextArea')" />

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-04-02
    • 2011-05-30
    • 2011-05-28
    • 2010-10-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多