我正在使用jQuery AutoComplete插件。
我正在将它用于文本区域。
当自动完成显示选项时,它会正确显示文本,如下所示
http://s17.postimage.org/jpifb51tr/before.jpg
用户从“自动完成”选项中选择文本后,它会显示如下 http://s12.postimage.org/5vyj1hs19/After.gif
我的自动完成脚本
var data = "my directions string with / deelininator"
data = data.replace(/</g, '<');
data = data.replace(/>/g, '>');
directions = data.split("/");
// alert(directions);
$("TextArea").autocomplete(directions, {
matchContains: true,
minChars: 1
});
我该如何避免这种情况?
更新 - 尝试以下建议无用
<小时/> 我尝试使用unescape但没有使用
$("textarea").blur(function () {
var test = $(this).val();
//alert(test);
$(this).val(unescape(test) + "sss");
});