开发者社区 问答 正文

Jquery 对象数组的值问题

我有html

    <b class='a'>111</b>
    <b class='a'>222</b>
    <b class='a'>333</b>
    <b class='b'>aaa</b>

请问怎么快速得到一个数组 [111,222,333];

尝试过

$(".a").text();

展开
收起
小旋风柴进 2016-03-26 08:08:21 1763 分享 版权
1 条回答
写回答
取消 提交回答
  • $('.a').map(function (item){
        return $(item).text();
    });
    2019-07-17 19:15:01
    赞同 展开评论
问答分类:
问答地址: