innerHTMLinnerHTML*
*



Contents  *



Index  *Topic Contents
*Previous Topic: index
*Next Topic: innerText

innerHTML

Description

Sets or retrieves the HTML between the start and end tags of the current element.

Syntax

object.innerHTML[ = innerHTML]

Settings

This read-write property takes a string containing a valid combination of text and HTML tags, except for <html>, <head>, and <title> tags.

When setting this property, the given string completely replaces the existing content of the element. If the string contains HTML tags, the string is parsed and formatted as it is placed into the document.

Note You cannot set this property while the document is loading. Wait for the onload event before attempting to set it. If a tag is dynamically created using TextRange, innerHTML, or outerHTML, you can only use JScript to create new events to handle the newly formed tags. VBScript is not supported.

Applies To

A, ACRONYM, ADDRESS, B, BIG, BLOCKQUOTE, BODY, BUTTON, CAPTION, CENTER, CITE, CODE, DD, DEL, DFN, DIR, DIV, DL, DT, EM, FIELDSET, FONT, FORM, H1, H2, H3, H4, H5, H6, I, IFRAME, IMG, INS, KBD, LABEL, LEGEND, LI, LISTING, MAP, MARQUEE, MENU, OL, P, PRE, Q, S, SAMP, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TH, TT, U, UL, VAR

See Also

insertAdjacentHTML method


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.