American English Spelling Checker Tool Free
Dictionary: ${dictionaryType === 'american' ? 'American English' : 'British English'}
`; if (errorCount === 0 && checkedWords > 0) { resultsDiv.innerHTML = 'No spelling errors found!
'; } } // Function to replace a word in the textarea function replaceWord(oldWord, newWord) { const text = textInput.value; const startPos = textInput.selectionStart; const endPos = textInput.selectionEnd; // Simple replacement (could be improved to handle multiple instances) const newText = text.replace(new RegExp(`\\b${oldWord}\\b`, 'g'), newWord); textInput.value = newText; // Rerun spell check checkSpelling(); } // Event listeners checkSpellingBtn.addEventListener('click', checkSpelling); clearTextBtn.addEventListener('click', function() { textInput.value = ''; resultsDiv.innerHTML = ''; statsDiv.innerHTML = ''; }); dictionarySelect.addEventListener('change', function() { if (textInput.value.trim()) { checkSpelling(); } }); // Optional: Add live checking as user types textInput.addEventListener('input', function() { // For performance, you might want to debounce this // or only run it when the user pauses typing // checkSpelling(); }); });Features of this Spell Checker Tool:
- Dual Dictionary Support:
- Toggle between American and British English dictionaries
- Highlights differences like “color” vs “colour”
- Common Misspellings Detection:
- Catches and suggests corrections for frequently misspelled words
- Examples: “definately” → “definitely”, “recieve” → “receive”
- Interactive Interface:
- Click on highlighted errors to apply corrections
- Clear visual distinction between errors and suggestions
- Statistics Display:
- Shows word count and error count
- Indicates which dictionary is active
- User-Friendly Design:
- Clean, responsive layout
- Clear instructions and feedback