jquery - 带有对象变量的 JQuery concat 选择器
问题描述
我在div中几乎没有.children
元素。.parent
我想循环子元素。
//This is working good.
$('.parent .children').each(function(){
//working good.
});
//But I would like to do that in the following way-
var parent = $('.parent');
$(parent + ' .children').each(function(){
});
这次我收到以下错误-
jquery.min.js:2 未捕获错误:语法错误,无法识别的表达式:[object Object] .children
有什么帮助吗?
解决方案
推荐阅读
- sql-server - 如何在多个数据库中加入多表
- wordpress - 如何在您的网络服务器上创建与永久链接同名的地图而不会出现 403 错误
- sql - 动态查询在sql server中查找列中的行长
- javascript - React-native 如何在另一个 javasript 文件中使用状态值
- excel - Excel VBA更改范围内另一列和行中的值
- reactjs - React 中的组件拆分导致 TypeScript 错误
- c# - 如何在 Windows 窗体应用程序安装期间读取文本文件
- r - 旋转马赛克图的标签
- python - 为什么重复 pd.series 不能按预期工作?
- python - 如何为 `scipy.interpolate.splev` 提供特定的 x 值?