Name

insertAdjacentHTML( ) — NN n/a IE 4 DOM n/a

Synopsis

insertAdjacentHTML(where, HTMLText)

Inserts text into the designated position relative to the element’s existing HTML. If HTML tags are part of the text to be inserted, the browser interprets the tags and performs the desired rendering. This method is not supported in many objects in the Macintosh version of Internet Explorer 4.

Returned Value

None.

Parameters

where

String value of one of the following constants: BeforeBegin | AfterBegin | BeforeEnd | AfterEnd. The first and last locations are outside the HTML tags of the current element; the middle two locations are between the tags and element content.

HTMLText

String value of the text and/or HTML to be inserted in the desired location.

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.