替换无序列表(html)+ JQuery中的值 [英] Replace value in unordered list (html) + JQuery
本文介绍了替换无序列表(html)+ JQuery中的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只需使用JQuery更改<span>
和</span>
D1,D2,D3之间的值,并使用JQuery更改X1,X2,X3等新值.
I need to change just the values between <span>
and </span>
D1, D2, D3 with JQuery, with new values like X1,X2,X3 with JQuery.
推荐答案
使用
$('#navigation').find('span').each(function(){
var $this = $(this);
$this.text(function(i, curr){
return curr.replace(/D/, 'X');
});
});
这完全符合您的示例.
这篇关于替换无序列表(html)+ JQuery中的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文