Search code examples
domyuiyui3

Creating a document fragment in YUI 3


I've been searching the docs for YUI3, but I cannot seem to figure out how to create a document fragment. Should I just use the document object itself? I would like to treat it as a YUI Node object.


Solution

  • If you want to create a new empty docfrag, this should work:

    var frag = Y.all([]).toFrag();
    

    frag is then a Node instance wrapping the docfrag.