Function createFragment

  • Shorthand for creating a DocumentFragment from HTML text.

    Parameters

    • html: string

      The outerHTML of what to create

    Returns DocumentFragment

    Example

    import { createFragment } from 'inherent';
    const frag1 = createFragment(`
    <p>Para 1</p>
    <p>Para 2</p>
    `)
    // <p>Para 1</p><p>Para 2</p>