I have a textarea that has spellcheck = "false"
. I want to have a button that when clicked turns on spellcheck
and checks the spelling of what is already typed.
At present, if you enter anything else in the text box after the button click, it checks spelling properly. However, I would like it to spell check what's already there without needing to enter anything additional in textarea.
<textarea id="ta" spellcheck="false"></textarea>
<div>
<input type="button" id="spell_btn" value="spell check">
</div>
$(document).on('click', '#spell_btn', null, function () {
$("#ta").attr("spellcheck", "true");
});//close .click
https://jsfiddle.net/906dqtn6/5/
I tried to reset the value using $('#ta').val()
but
didn't have any effect.
var x = $("#ta").val();
var y = " ";
$("#ta").val(y);
$("#ta").val(x);
Thanks in advance.