Manipulation/API/jQuery
wrapAll(elem)
wrapAll(html)と同様だが、HTML文字列ではなくDOM Elementなどを指定する。
wrap(elem)関数との違いも、上記 wrapAll(html) を参照のこと。
引数
- elem
Element
DOM Element
サンプル
サンプル1
複数のp要素を、新しいdivを1つ作って囲い込む。
<p>Hello</p>
<p>cruel</p>
<p>World</p>
$("p").wrapAll(document.createElement("div"));
[
フレーム]