JavaScript Tutorial – outerHTML – Dynamic markup insertion

partial interface Element {
[TreatNullAs=EmptyString] attribute DOMString innerHTML;
[TreatNullAs=EmptyString] attribute DOMString outerHTML;
void insertAdjacentHTML(DOMString position, DOMString text);

The outerHTML IDL attribute represents the markup of the Element and its contents.

Returns a fragment of HTML or XML that represents the element and its contents.
Can be set, to replace the element with nodes parsed from the given string.

In the case of an XML document, will throw an InvalidStateError if the element cannot be serialized to XML, and a
SyntaxError if the given string is not well-formed.

Throws a NoModificationAllowedError exception if the parent of the element is the Document node.

I highly recommend this book for beginners as well as advanced programmers:


Xem thêm bài viết:

No Tag

One Response

  1. Artem Nakhodkin says:

    Very detailed overview. Thanks. Now everything it's clear to me.

Leave a Reply

Your email address will not be published. Required fields are marked *

Dự đoán xổ số