使用jQuery如何 Select 单个子元素?我看过遍历API,知道我可以 Select 所有的直接子元素,如下所示:
$(this).children('img');
要 Select 第一个子img
元素,我可以使用如下下标:
$(this).children('img')[0];
但我想我有点惊讶我不能这么做:
$(this).child('img'); // no subscript, returns single element
Or have I missed something?