子选择器已弃用 [英] Child selector deprecated

查看:106
本文介绍了子选择器已弃用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:

http://api.jquery.com/child-selector/

什么是alternative selector?

解决方案

$(context).children('elem')

也不推荐使用$("> elem", context),但不推荐使用$(context+" >elem")$("parent>child")

Possible Duplicate:
What is the new proper way to use a child selector with a context node in jQuery?

From the jQuery docs:

Note: The $("> elem", context) selector will be deprecated in a future release. Its usage is thus discouraged in lieu of using alternative selectors.

http://api.jquery.com/child-selector/

What would be an alternative selector for this?

解决方案

$(context).children('elem')

also $("> elem", context) is deprecated, but $(context+" >elem") and $("parent>child") are not

这篇关于子选择器已弃用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆