如何在 HTML 中為文字新增拼寫檢查器?
要新增拼寫檢查器,請在 HTML 中使用 spellcheck 屬性。該屬性檢查輸入元素中的文字拼寫和語法,<textarea> 元素 和可編輯元素。
新增拼寫檢查
在文字型別標籤內寫入 spellcheck="true"。
<input type="text" name="sub" spellcheck="true">
注意 − 它適用於輸入元素,但不適用於密碼。
示例
您可以嘗試執行以下程式碼以在 HTML 中新增拼寫檢查器 −
<!DOCTYPE html> <html> <body> Subject: <input type="text" name="sub" spellcheck="true"> <p>Add an incorrect spelling for a word above and see what happens.</p> <p contenteditable="true" spellcheck="true">This is an editable conttent, with a spelling mistake. Click to edit.</p> </body> </html>
廣告
資料結構
網路
關係型資料庫管理系統
作業系統
Java
iOS
HTML
CSS
Android
Python
C 語言
C++
C#
MongoDB
MySQL
Javascript
PHP