首页
零基础教程
分类浏览
编 程
Sentinel
Go语言
C语言
汇编语言
Android
Java工具库
Spring Cloud Alibaba
Spring Cloud
Spring Data
Spring Boot
Spring Batch
JSP/Servlet
Hadoop
Dubbo
J2Cache
Hibernate
OpenJPA
MyBatis
ShardingSphere
Freemarker
Thymeleaf
Activiti
POI
JMail
Log4j
LogBack
Dom4j
XML
RxJava
JasperReport
JUnit
JMock
Apache Commons
HttpComponents
CGLib
WebSocket
ESAPI
设计模式
前 端
CSS/CSS3
HTML5
JavaScript
JQuery
DHTMLX
浏览器
HTML
前端小知识
Vue.js
NodeJS
ECharts
Less
UmiJS
React
Ant Design
Bootstrap
uni-app
JS-XLSX
数据库
SQL
PL/SQL
MySQL
Oracle
Redis
SQLite
MongoDB
Zookeeper
H2
服务器
Podman
Prometheus
Tomcat
JBoss
RocketMQ
Docker
Nginx
RabbitMQ
其 他
程序员
Maven
SVN
Git
UML
Windows
办公软件
Axure
Jenkins
HTTP
macOS
Java
Spring
Linux
AI
代码片段
Get小技能
面试题
开发工具
<html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>JQeury 教程</title> <!-- 引入 jQuery 库 --> <script type="text/javascript" src="https://www.hxstrive.com/cdn/libs/jquery/3.7.1/jquery.min.js"></script> <!-- 引入 loglevel 库,方便在 DOM 中打印日志 --> <script src="https://www.hxstrive.com/preview_code/libs/custom_loglevel.js"></script> <style> button { background: #EEE !important; border: 1px solid #ccc !important; min-width: 40px; padding: 5px; margin: 5px; cursor: pointer; } h3 { font-size: 18px; } .container { border: 1px solid blue; padding: 10px; } .inner { border: 1px solid red; padding: 10px; margin: 5px; } .wrap { box-shadow: inset 0 0 3px green; padding: 5px; margin: 5px; } </style> </head> <body> <div class="app"> <h3>包裹</h3> <div class="container"> <div class="inner">Hello</div> <div class="inner">Goodbye</div> </div> </div> <div> <!-- wrap(html|ele|fn) 把所有匹配的元素用其他元素的结构化标记包裹起来 --> <button type="button" onclick=" // 将 class 为 inner 的元素包裹在 class 为 wrap 的 div 中 $('.inner').wrap('<div class=\'wrap\'></div>'); ">wrap(html|ele|fn)</button> <!-- unwrap() 这个方法将移出元素的父元素 --> <button type="button" onclick=" // 移除 class 为 inner 的元素的所有父级元素 $('.inner').unwrap(); ">unwrap()</button> <!-- wrapAll(html|ele) 将所有匹配的元素用单个元素包裹起来 --> <button type="button" onclick=" // 将所有 class 为 inner 的元素包裹在同一个 div 中 $('.inner').wrapAll('<div class=\'wrap\'></div>'); ">wrapAll(html|ele)</button> <!-- wrapInner(html|ele|fn) 将每一个匹配的元素的子内容(包括文本节点)用一个HTML结构包裹起来 --> <button type="button" onclick=" // 将每个 class 为 inner 的元素的内容包裹在 div 中 $('.inner').wrapInner('<div class=\'wrap\'></div>'); ">wrapInner(html|ele|fn)</button> </div> </body> </html>
在线代码编辑器
代码编辑区
自动执行
运行
选择模板
选择JS库
预览效果
清空
切换主题
字符数: 0
提示: 输入完整的HTML代码,包括<!DOCTYPE>和<html>标签
更多工具
Base64 加密/解密工具
JSON 格式化工具
密码随机生成工具
哈希值计算工具
时间戳转换工具
图片 & Base64 互转
HTTP 客户端
Websocket 客户端
选择模板
取消
选择库和版本
库
版本
文件
取消
已复制到剪贴板
关于
本网站专注于 Java、数据库(MySQL、Oracle)、Linux、软件架构及大数据等多领域技术知识分享。涵盖丰富的原创与精选技术文章,助力技术传播与交流。无论是技术新手渴望入门,还是资深开发者寻求进阶,这里都能为您提供深度见解与实用经验,让复杂编码变得轻松易懂,携手共赴技术提升新高度。如有侵权,请来信告知:hxstrive@outlook.com
链接
免责声明
隐私政策
其他应用
开源镜像网站
公众号
©2018-2020 hxstrive.com 版权所有 ICP证:
蜀ICP备14031461号-2
川公网安备51010802032098