Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

The createContextualFragment method

The createContextualFragment() method enables you to parse a string of HTML into a DocumentFragment using the starting node of a Document Object Model (DOM) Range as the parsing context. Unlike inserting markup into innerHTML, the method can be used to create pre-parsed content to be added or inserted into a document when needed later.

The syntax of the createContextualFragment method is as follows:

oFragment = oRange.createContextualFragment(string); 

The parameters are described here:



A DocumentFragment object.


A DOM Range object.


A string containing the HTML to parse.


Related topics

Document Object Model (DOM)
Internet Explorer 10 Guide for Developers



© 2016 Microsoft