如何為 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