Export (0) Print
Expand All

surroundContents method

Moves the contents of a Range to a new parent node, placing the new parent node at the start position of the Range.

Document Object Model (DOM) Level 2 Traversal and Range Specification, Section 2.13Internet Explorer 9

Syntax


HRESULT retVal = object.surroundContents(newParent);

Parameters

newParent [in]

Type: Node

The new node to make the parent.

Return value

Type: HRESULT

This method can return one of these values.

Return codeDescription
S_OK

The operation completed successfully.

HierarchyRequestError

A document type node is included in the Range that is being cloned.

InvalidStateError

IHTMLDOMRange::detach has been invoked on the object.

NoModificationAllowedError

A boundary point in the Range is read-only.

 

Standards information

Remarks

If the newParent already exists in the document, its content is removed.

 

 

Community Additions

ADD
Show:
© 2014 Microsoft