javascript - How to create a word checker with jquery -
i'm trying develop simple script reads words of string, , compare dictionary .txt
or array of correct words.
the format of string this:
<data> <value>testy</value> </data> <data> <value>helllo wordi</value> </data> <data> <value>gren titl</value> </data> <data> <value>nanme</value> </data>
he can apply fix on words have within <value>
tag. have me return should same structure words corrected. form.
<data> <value>test</value> </data> <data> <value>hello word</value> </data> <data> <value>green title</value> </data> <data> <value>name</value> </data>
is possible this? if yes how can doing in code? example?
$('button').click(function () { var code = $('textarea[name=message]').val(); if ($('#output').length < 1) { $("body").append('<h2>output</h2><textarea id="output" rows="10" cols="100"></textarea>'); } $('#output').val(code); });
my english bad hope question has been clear , can understood you.
i if have dictionary can use :
$("value").onkeydown(function() { var testval = $(this).text(); if ($.inarray(testval, yourdictionaryarray) > -1) { //handle if word in dict } else { //handle word not in dict.. } });
Comments
Post a Comment