Force spell check on a textarea in WebKit

Asked
Active3 hr before
Viewed126 times

8 Answers

forcecheck
90%

Is there a way to force WebKit to add the little red spell check underlines to textareas?, GitLab launches Collective on Stack Overflow , Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers , Stack Overflow help chat

Essentially you need to use the selection api to move the insertion point over each word to get Safari to highlight it. Here's an example to scan over the first thousand words...

textarea = document.getElementById("mytextarea");
textarea.focus();

var selection = window.getSelection();
selection.modify("move", "backward", "line");
for (var i = 0; i < 1000; i++) {
   selection.modify("move", "forward", "word");
}

// Remove focus from the element, since the word under
// the cursor won't have a misspelling marker.
textarea.blur();
load more v
88%

Is there a way to force WebKit to add the little red spell check underlines to textareas?,In general, typical uses of custom dictionaries should continue working as usual - with little difference between .NET 4.6.1 vs previous releases. ,This code was lifted from the WebKit Layout test suite.,JavaScript spell-checking libraries do exist. I ran across this a little while ago: http://www.chrisfinke.com/2011/03/31/announcing-typo-js-client-side-javascript-spellchecking/

Essentially you need to use the selection api to move the insertion point over each word to get Safari to highlight it. Here's an example to scan over the first thousand words...

textarea = document.getElementById("mytextarea");
textarea.focus();

var selection = window.getSelection();
selection.modify("move", "backward", "line");
for (var i = 0; i < 1000; i++) {
   selection.modify("move", "forward", "word");
}

// Remove focus from the element, since the word under
// the cursor won't have a misspelling marker.
textarea.blur();
load more v
72%

If this attribute is not set, its default value is element-type and browser-defined. This default value may also be inherited, which means that the element content will be checked for spelling errors only if its nearest ancestor has a spellcheck state of true.,Note: The spellcheck attribute is an enumerated one and not a Boolean one. This means that the explicit usage of one of the values true or false is mandatory, and that a shorthand like <textarea spellcheck></textarea> is not allowed. The correct usage is <textarea spellcheck="true"></textarea>.,false, which indicates that the element should not be checked for spelling errors.,true, which indicates that the element should be, if possible, checked for spelling errors;

load more v
65%

The spellcheck attribute specifies whether the element is to have its spelling and grammar checked or not.,If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:,The numbers in the table specify the first browser version that fully supports the attribute.

Definition and Usage

The spellcheck attribute specifies whether the element is to have its spelling and grammar checked or not.

spellcheck
75%

Topic: HTML / CSSPrev|Next,How to disable resizable property of textarea using CSS,How to disable text selection highlighting in the browsers using CSS,How to change input field or textarea placeholder text color using CSS

<!DOCTYPE html>
<html lang="en">

<head>
   <meta charset="utf-8">
   <title>Disable Spell Checking</title>
</head>

<body>
   <form>
      <p>
         <input type="text" spellcheck="false">
      </p>
      <p>
         <textarea spellcheck="false"></textarea>
      </p>
      <button type="reset">Reset</button>
   </form>
</body>

</html>
40%

Syntax for spellcheck in a textarea field in html: ,Internet Explorer 11.0,Syntax : Syntax for spellcheck attribute in an input field in html:  ,Interview Experiences

Syntax : 
Syntax for spellcheck attribute in an input field in html:  

<input type="text" spellcheck="value">

Syntax for spellcheck in a textarea field in html: 

<textarea type="text" spellcheck="value"></textarea>
load more v
22%

When the spellcheck attribute is not included, the default value depends on the element and browser. Generally, contenteditable and <textarea>s behave as if it were set to “true”, and <input>s behave as if it were set to “false”.,Values include “true” and “false”, and are required if thespellcheck attribute is present.,The global spellcheck attribute tells a browser whether or not to check the spelling/grammar of the text in an editable element.,Typical browser handling is underlining problem words/phrases with red and offering contextual menu help.

The Low Down

The global spellcheck attribute tells a browser whether or not to check the spelling/grammar of the text in an editable element.

spellcheck
load more v
60%

I used this question to get an answer to your question: Force spell check on a textarea in WebKit,I run into this problem. I have a textarea which I only want to use spell check when it's in focus.,Get answers to millions of questions and give back by sharing your knowledge with others.,The Contents are licensed under creative commons.

I run into this problem. I have a textarea which I only want to use spell check when it's in focus.

<textarea id="editor"></textarea>

$('#editor').focusin(function(){
    $(this).attr('spellcheck', true);
});

$('#editor').focusout(function(){
    $(this).attr('spellcheck', false);
});
load more v

Other "force-check" queries related to "Force spell check on a textarea in WebKit"