开发者

How to use jquery to select all the children of an element as well as all images

$('img, div.name < *')

Only returns the first children but i need all of them. I can do it in two statements, bu开发者_开发技巧t i need to do it in one since i want to :not the expression.

:not ( $('div.name').children() + $('img') )

Is what i'm trying to achieve. Thanks!


$('div.name > *, img');

should do it.


If you're trying to select descendants, not just direct children, use *

$('img, div.name *')

> will only get you the direct children of that object, but it might not matter

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜