diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:43:23 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:43:23 -0500 |
commit | 218934fa2ed1c702a6d3923d2aa2cc6b43c48684 (patch) | |
tree | a9ef8ac1e1b8fe4207b6d64d3841bfb8990b6fd0 /files/zh-tw/web/html/global_attributes/spellcheck | |
parent | 074785cea106179cb3305637055ab0a009ca74f2 (diff) | |
download | translated-content-218934fa2ed1c702a6d3923d2aa2cc6b43c48684.tar.gz translated-content-218934fa2ed1c702a6d3923d2aa2cc6b43c48684.tar.bz2 translated-content-218934fa2ed1c702a6d3923d2aa2cc6b43c48684.zip |
initial commit
Diffstat (limited to 'files/zh-tw/web/html/global_attributes/spellcheck')
-rw-r--r-- | files/zh-tw/web/html/global_attributes/spellcheck/index.html | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/files/zh-tw/web/html/global_attributes/spellcheck/index.html b/files/zh-tw/web/html/global_attributes/spellcheck/index.html new file mode 100644 index 0000000000..65cd9dea57 --- /dev/null +++ b/files/zh-tw/web/html/global_attributes/spellcheck/index.html @@ -0,0 +1,39 @@ +--- +title: 控制 HTML 表單中的拼字檢查功能 +slug: Web/HTML/Global_attributes/spellcheck +translation_of: Web/HTML/Global_attributes/spellcheck +--- +<p>Firefox 2 新增了網頁表單文字輸入區的即時拼字檢查功能,使用者可以修改 about:config 來調整是否使用拼字檢查、是否同時檢查文字輸入<b>欄</b>等設定。預設值狀態下,Firefox 會檢查文字輸入區(text area)及 <code>designMode</code> 的文件,而不檢查文字輸入欄(text field)的拼字。</p> + +<p>不過,總是會有些不見得適合預設值的情況,例如在某些用來編寫 HTML 等程式碼的輸入區中拼字檢查就變得煩人,或者有些網站也希望建議 Firefox 檢查某些特定文字輸入欄的拼字等等。</p> + +<p>若網站對某特定 <code><input></code> 元素中的拼字檢查執行與否有所建議,則可使用 <code>spellcheck</code> 屬性。將此屬性設為 <code>true</code> 表建議檢查拼字,而設為 <code>false</code> 則相反。</p> + +<p>若使用者將 <code>layout.spellcheckDefault</code> 直接設為 0 以關閉拼字檢查功能,那麼網站的建議就無效;若設為其他值,則會將網站建議列入考量。</p> + +<p>舉例來說,你可以撰寫如下的 HTML 碼,建議 Firefox 檢查此文字輸入欄(<code><input></code> 元素)中的拼字:</p> + +<pre class="eval"><span class="nowiki"><input type="text" size="50" spellcheck="true"></span> +</pre> + +<p>也可以撰寫這樣的 HTML 碼,建議 Firefox 不要檢查文字輸入區的拼字:</p> + +<pre class="eval"><span class="nowiki"><textarea spellcheck="false"></textarea></span> +</pre> + +<p>而 <code>designMode</code>(通常用於 HTML 所見即所得編輯)則可以在文件的 <code><body></code> 標籤中設定 <code>spellcheck</code> 屬性來控制拼字檢查。</p> + +<p><code>spellcheck</code> 屬性也可以放在 <code><span></code> 或 <code><div></code> 等其他標籤中,這麼一來在此元素下所有未另行設定 <code>spellcheck</code> 屬性的 <code><input></code> 元素將繼承此設定;而若皆未設定則使用者的決定將優先採行。</p> + +<p>舉例而言:</p> + +<pre><div spellcheck="true"> + <label>輸入英文句子: </label><input type="text" size="50"> + <br /> + <label>再打一句: </label><input type="text" size="50"> +</div> +<br /> +<label>最後一句: </label><input type="text" size="50"> +</pre> + +<p>在這段 HTML 程式碼中,頭兩個文字輸入區域將檢查拼字,第三個則不會。</p> |