作者:月光女孩2602906135_166 | 来源:互联网 | 2023-01-31 13:20
我有这样的清单
如何在"."之后得到文本.并插入"类型"?结果应该是这样的
Pranav C Bal..
6
迭代跨度并.
使用相邻兄弟中的点()之后的文本更新文本内容.
// use text method with callback to iterate and update
// based on the returned value
$('.example .type').text(function() {
return $(this)
// get the a tag
.next()
// get text content
.text()
// split the text
.split('.')
// get the last element from array
.pop();
})
1> Pranav C Bal..:
迭代跨度并.
使用相邻兄弟中的点()之后的文本更新文本内容.
// use text method with callback to iterate and update
// based on the returned value
$('.example .type').text(function() {
return $(this)
// get the a tag
.next()
// get text content
.text()
// split the text
.split('.')
// get the last element from array
.pop();
})