Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created May 15, 2020 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/1c62cad06bd7cf2a79f26f08ec29f067 to your computer and use it in GitHub Desktop.
Save bjoerntx/1c62cad06bd7cf2a79f26f08ec29f067 to your computer and use it in GitHub Desktop.
async function checkText() {
// call the check method
var results = await TXSpell.check(document.getElementById('textbox').textContent);
// check console for details
console.log(results);
var consoleText = "";
// loop through the results and return the text
results.forEach(function (element) {
consoleText += "<p>Misspelled: <strong>" + element.text + "</strong></p>";
});
document.getElementById('results').innerHTML = consoleText;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment