HTML writingsuggestions Global Attribute
Description
The writingsuggestions attribute is a global HTML attribute that provides hints to the browser or user agent about the types of writing suggestions it may offer to the user when they are entering text into an editable field. This attribute is particularly useful in contexts where a web application wants to influence the suggestions provided by spell checkers, virtual keyboards, or other text input enhancement tools.
Purpose
The main purpose of writingsuggestions is to improve the quality and relevance of text input suggestions. By specifying the expected type of input, developers can help user agents provide more appropriate autocompletion, correction, or recommendation options.
Attribute Values
The writingsuggestions attribute can accept the following predefined keywords, or a comma-separated list of them:
none– No suggestions should be provided. The browser or input method should avoid offering corrections or suggestions for the content.spell– The user agent may provide spelling suggestions for the input.grammar– Grammar suggestions can be offered, such as punctuation or sentence structure corrections.list– Provides a set of predefined suggestions for the input, often from adatalistelement associated with the input field.phrases– Suggests entire phrases or common word combinations instead of single-word corrections.
Developers can combine multiple values by separating them with spaces. For example:
<input type="text" writingsuggestions="spell grammar">
This indicates that both spelling and grammar suggestions are desired for this input field.
Usage Context
The writingsuggestions attribute is typically used on:
<input>elements (type="text",email,search, etc.)<textarea>elements- Any element with the
contenteditableattribute
Example
<!-- Input field with spelling suggestions only -->
<input type="text" writingsuggestions="spell" placeholder="Enter your name">
<!-- Textarea with spelling and grammar suggestions -->
<textarea writingsuggestions="spell grammar" rows="4" cols="50">
Type your essay here...
</textarea>
<!-- Input field with no suggestions -->
<input type="text" writingsuggestions="none" placeholder="Sensitive input">
Notes
- The
writingsuggestionsattribute is advisory. User agents are not required to follow it and may ignore it depending on their capabilities. - It is complementary to other input-related attributes such as
autocomplete,autocorrect, andspellcheck, which control different aspects of text input behavior. - This attribute can help improve user experience in forms where input correctness or suggestions are important, such as writing applications, comment sections, or email composition interfaces.
Syntax
<element writingsuggestions="value">
Values
- noneNo suggestions should be provided. The browser or input method should avoid offering corrections or suggestions for the content.
- spellThe user agent may provide spelling suggestions for the input.
- grammarGrammar suggestions can be offered, such as punctuation or sentence structure corrections.
- listProvides a set of predefined suggestions for the input, often from a
datalistelement associated with the input field. - phrasesSuggests entire phrases or common word combinations instead of single-word corrections.
Example
Browser Support
The following information will show you the current browser support for the HTML writingsuggestions global attribute. Hover over a browser icon to see the version that first introduced support for this HTML global attribute.
This global attribute is supported in some modern browsers, but not all.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 27th December 2025
