Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8100403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:43:44+00:00 2026-06-05T22:43:44+00:00

I run into this problem. I have a textarea which I only want to

  • 0

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);
});

In chrome, if a word is misspelled there is a red line under the word. Even if I turn off the spell checker, the red line still exists. How do I remove this marker?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:43:45+00:00Added an answer on June 5, 2026 at 10:43 pm

    got it figured out

    function bindEditorFocus() {
        var $editor = $('#editor');
        $editor.focusin(function(){
            $(this).attr('spellcheck', true);
            toggleSpellingcheck(); // loop through all words to add marker
        }); 
        
        $editorblur(function(){
            $editor.attr('spellcheck', false);
            $editor.unbind();    // I need to unbind all function to avoid a loop 
            toogleSpellingcheck(); // loop through all words to remove marker
            $editor.blur();     //get out of text area
            bindEditorFocus();  // rebind all functions 
        });
    }
    
    
    function toogleSpellingcheck(){ 
        //this will loop through all words
        var $editor = $('#editor'); 
        var text = $editor.val();       
        for (var i = 0; i < text.length; i++) {
            $editor.caret({start:i,end:i});
        }
    }
    

    the toogleSpellingcheck method loop through all words, it can be optimized to loop through words instead of characters, but this would need the jquery caret plugin

    it’s a bit messy, but works, anyone got suggestions on improvements please let me know

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have run into this problem a few times and I'm not happy with
NOTE: I have solved the majority of this problem but have run into a
I've run into another problem while fixing up my game to use this library.
Apparently many people have run into this problem, but I have yet to be
I have run into this problem again and now really need to know how
I have run into this problem a lot in the past, but never really
I have run into this problem: Custom Methods & Extension Methods cannot be translated
I have run into this problem across multiple programming languages and I was just
I run into this problem constantly while developing AJAX applications. Let's say I want
I have run into this problem a few times and have never come up

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.