Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / HTML

writingsuggestions — suggestions while typing

The writingsuggestions attribute controls whether a browser should offer writing suggestions. Its setting can be inherited; user preferences take precedence.

Version: WHATWG HTML Living Standard; index snapshot date recorded separately

Syntax

writingsuggestions="true" | writingsuggestions="false" | writingsuggestions=""

writingsuggestions is an enumerated attribute, not a boolean attribute: true allows suggestions and false disables them. An empty or invalid value means the True state, not disabled.

Omitting the attribute selects Default: the computed value inherits false from the parent, otherwise becoming true. Explicit true overrides inherited disabling.

Suggestions apply to editable regions and mutable textarea and input controls of types text, search, tel, url, email. The attribute does not itself enable editing. Users can disable suggestions; the standard does not specify their interface.

The DOM property writingSuggestions returns the string "true" or "false", not a boolean. It can also be set. Reading it ignores overriding user preferences, so it does not prove that suggestions will actually appear.

Examples

<!doctype html>
<meta charset="utf-8">
<title>writingsuggestions</title>
<div writingsuggestions="false">
  <label>Draft <textarea id="draft"></textarea></label>
  <label>Assisted draft <textarea id="assisted" writingsuggestions="true"></textarea></label>
</div>
<pre id="result"></pre>
<script>
  const draft = document.getElementById('draft');
  const assisted = document.getElementById('assisted');
  document.getElementById('result').textContent =
    `${draft.writingSuggestions}\n${assisted.writingSuggestions}`;
</script>

Result

false
true

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources