开发者

jQuery select an anchor inside div with numeric id attribute

开发者 https://www.devze.com 2023-03-02 15:59 出处:网络
How to select all the \'a\' element\'s id inside a div tag with id开发者_Python百科 \"12\"?Technically you can\'t have an ID starting with a number (until HTML5, anyways), but this should work:

How to select all the 'a' element's id inside a div tag with id开发者_Python百科 "12"?


Technically you can't have an ID starting with a number (until HTML5, anyways), but this should work:

$("#12 > a")


var linkIDs = $('#12 a').map(function(link) {
    return link.id;
}).get();
0

精彩评论

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

关注公众号