jQuery wrapAll() 方法

jQuery 教程 · 2019-03-27 20:59:26

实例

在 <div> 元素中包裹所有 <p> 元素:

$("button").click(function(){ $("p").wrapAll("<div></div>"); });

定义和用法

wrapAll() 方法使用指定的 HTML 元素来包裹所有被选元素。

语法

$(selector).wrapAll(wrappingElement)

参数 描述
wrappingElement 必需。规定包裹被选元素的 HTML 元素。

可能的值:

  • HTML 元素
  • jQuery 对象
  • DOM 元素

点击查看所有 jQuery 教程 文章: https://codercto.com/courses/l/35.html

查看所有标签

Real-Time Rendering, Third Edition

Real-Time Rendering, Third Edition

Tomas Akenine-Moller、Eric Haines、Naty Hoffman / A K Peters/CRC Press / 2008-7-25 / USD 102.95

Thoroughly revised, this third edition focuses on modern techniques used to generate synthetic three-dimensional images in a fraction of a second. With the advent or programmable shaders, a wide varie......一起来看看 《Real-Time Rendering, Third Edition》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

html转js在线工具
html转js在线工具

html转js在线工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具