只是我发现下面的代码本质上是倒退的吗?
我正在使用此帖子作为参考.
// create the inner div var $inner = $("inner") // append it to a new outer div .appendTo("outer") // next change the jQuery chain to the "outer" div .parent() // append the outer div to the body .appendTo("body") // finally, go back to the last destructive command, // giving us back a pointer to the "inner" div .end();
我最初的方法是抓住身体,然后在身体外面附上一个外层,然后在内部附加一个内部.
接近它然后跳过层次结构,parent ()
只是让我觉得有点好奇......
你也可以用另一种方式做到这一点:
$('body').append('outer').append('inner');但这会让你离开
body
最终
inner
你需要:$('body').append('outer').append('inner') .find('div:contains(inner)');推荐阅读
如何解决《选择兄弟的文本》经验,为你挑选了1个好方法。 ... [详细] 如何解决《SpringSecurity:如何将重定向查询参数添加到登录URL以允许页面加书签?》经验,为你挑选了1个好方法。 ... [详细] 如何解决《GStreamer-从Raspberry到VLC-PC的网络摄像头流》经验,为你挑选了1个好方法。 ... [详细] 如何解决《c++支持模板元编程中的最后一次调用优化》经验,为你挑选了0个好方法。 ... [详细] 如何解决《一个ACE编辑器的瘦包装器,用于制作React组件》经验,为你挑选了1个好方法。 ... [详细] 如何解决《用PyBrain神经网络预测时间序列数据》经验,为你挑选了1个好方法。 ... [详细] 如何解决《CSS覆盖规则》经验,为你挑选了1个好方法。 ... [详细] 如何解决《using语句外的SQLConnection构造函数》经验,为你挑选了1个好方法。 ... [详细] 如何解决《在MATLAB中反表制函数》经验,为你挑选了1个好方法。 ... [详细] 如何解决《MQTT:每分钟MQTT客户端轮询服务器多少次?》经验,为你挑选了1个好方法。 ... [详细] 如何解决《如何在Angular2中将对象从一个组件传递到另一个组件?》经验,为你挑选了3个好方法。 ... [详细] 如何解决《如何在Xamarin.Android上处理三倍(或配置的数字)轻击手势?》经验,为你挑选了1个好方法。 ... [详细] 如何解决《从控制器触发模态弹出窗口》经验,为你挑选了1个好方法。 ... [详细] 如何解决《表之间的多对多关系-如何在SQL中建模》经验,为你挑选了1个好方法。 ... [详细] 如何解决《升级到php-7后"调用未定义的函数mysql_connect()"》经验,为你挑选了1个好方法。 ... [详细] 如何解决《将现有Watchkit应用程序更新为WatchOS2》经验,为你挑选了0个好方法。 ... [详细] 如何解决《SQLServer外键,引用表》经验,为你挑选了1个好方法。 ... [详细] 如何解决《Android:布局动画,如Inshorts新闻应用》经验,为你挑选了1个好方法。 ... [详细] 如何解决《单击使用react-native时如何更改图像和文本颜色?》经验,为你挑选了3个好方法。 ... [详细] 如何解决《如何在android中删除Recyclerview项目之间的分隔符》经验,为你挑选了2个好方法。 ... [详细]吐了个 "CAO" !Tags | 热门标签RankList | 热门文章
- 1如何将变量和文件传递给perl -p -e命令
- 2Spree Guest电子邮件已保存
- 3Spark中的嵌套JSON
- 4对和值之间的Java映射
- 5OpenID Connect Providers是否加密然后签署他们的JWT?
- 6使用ES6时,如何在一个文件中定义导入的函数,而在另一个文件中不定义?
- 7openshift让我们加密证书
- 8使用协议将案例添加到现有枚举
- 9多项任务混淆
- 10在Core Data中存储Swift值类型
- 11如何在MS WIndows 7中获取音频设备的插孔信息
- 12从varagin将可变数量的字符串传递给MATLAB函数
- 13为什么Oracle Java编译器不能在这里推断出界限,但Eclipse可以?
- 14在SQL右连接中加入约束做什么吗?
- 15包装std :: ignore
- 16在MS Excel中计算具有特定数据类型的单元格数
- 17Python使用https的代理请求API以获得407代理身份验证
- 18Windows和System命名空间之间有什么区别?
- 19Android-Recycler视图设置项无法滑动
- 20避免.ipa中的SwiftSupport文件夹
DevBox开发工具箱 | 专业的在线开发工具网站 京公网安备 11010802040832号 | 京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有