开发者

Get the value of id from spans inside a div using jquery

开发者 https://www.devze.com 2022-12-22 09:58 出处:网络
I want to get the id value from the span开发者_运维百科s. Thanks Jeanvar ids = $(\'div span\').map(function() {

I want to get the id value from the span开发者_运维百科s.

Thanks Jean


var ids = $('div span').map(function() {
    return $(this).attr('id');
});

Your question isn't very clear so this is all I can come up with.


$('span').each(function() {
    alert(this.id);
});
0

精彩评论

暂无评论...
验证码 换一张
取 消