jQuery:我可以用 $ ('.superset' ).$ ('.within' ) 代替 $ ('.within' , $ ('.superset' )) 吗?

标签 jquery css-selectors

可以扩展 jQuery 以便我可以使用上述语法吗?

我不知道如何对 $() 返回的内容进行原型(prototype)设计,以便我可以调用 $().$()

谢谢。

最佳答案

您可以使用find()

例如:$('.superset').find('.within');

或更简单,$('.superset .within');

关于jQuery:我可以用 $ ('.superset' ).$ ('.within' ) 代替 $ ('.within' , $ ('.superset' )) 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/358230/

相关文章:

javascript - Flask 应用程序在外部文件中时不执行 javascript

javascript - 菜单列表溢出 HTML(也在 iframe 中)

javascript - Css jQuery 蛇尝试

javascript - 通过 Javascript 检查 img 的纵横比

css - 如何在 SCSS 中使用 Mixin 覆盖引用父选择器

html - 选择:first-child or :last-child that doesn't contain some specific class

具有相同父类的逗号分隔元素的CSS简写?

javascript - 单击下一步时将 div 保存为图像

css - 缩短复杂的 CSS 选择器

css - 将第 n 个 child 中的 CSS 应用到第 n 个 child