开发者

jQuery select an anchor inside div with numeric id attribute

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜