[Edge]。→、
element の開始タグまたは終了タグの隣に指定のテキストを挿入します。
Element | Element。 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
where | DOMString。elementを基準とした挿入位置。
| ||||||||||
text | DOM ツリーに挿入するテキストの DOMString 表現。 |
Void。¶戻り値なし
HTML:
<DIV id=IdSoto>[DIV要素 <SPAN id=IdTest>[SPAN要素]</SPAN> ] </DIV>
JavaScript:
D=IdTest.insertAdjacentText("beforeBegin", "テキスト<B>[B要素±]</B>"); //開始タグの前にテキストを挿入。 DA=IdSoto.innerHTML; //挿入後の結果をHTMLコード文字列で表示。 //=[string]:[DIV要素 テキスト<B>[B要素&plusmn;]</&><span id="IdTest">[SPAN要素]</span> ]
insertAdjacentHTML()。insertAdjacentElement()、append()。