Indexing 用新文本替换JQuery UI网格中的文本

Indexing 用新文本替换JQuery UI网格中的文本,indexing,grid,html-lists,each,selectable,Indexing,Grid,Html Lists,Each,Selectable,我正在使用with选项进行多重选择,就像我在这里所做的那样: 有人能解释为什么我可以替换“标题”文本信息-2,但不能替换li标记中的文本信息-1 <li class="ui-state-default" title="Info-2">Info-1</li> 但不是这个: $('li').each(function(index2, temp2){ var tmp = $(temp2).text(); $(temp2).attr(tmp, ar[index

我正在使用with选项进行多重选择,就像我在这里所做的那样:

有人能解释为什么我可以替换“标题”文本信息-2,但不能替换li标记中的文本信息-1

<li class="ui-state-default" title="Info-2">Info-1</li>
但不是这个:

$('li').each(function(index2, temp2){ 
    var tmp = $(temp2).text();
    $(temp2).attr(tmp, ar[index2+1][kLan] ); });
这是我得到的错误:


jquery-1.9.1.js:2358无效字符\u错误:DOM异常5:指定了无效或非法字符,例如在XML名称中。

我自己发现了这个问题:

$('li').each(function(index, temp){ $(temp).html(ar[index+1][kLan] ); });
现在一切都很好

$('li').each(function(index, temp){ $(temp).html(ar[index+1][kLan] ); });