YUI3: Convert DOM Object to YUI3 Node and Convert YUI node to DOM element

DOM object to YUI3 Node:

Wrap the DOM element in Y.one() or Y.all() depending on DOM element is single element or a list. Y.Node() and Y.NodeList() is also available.

// returns a Y.Node instance
node = Y.one(document.createElement('span'));
// or
// node = new Y.Node(document.createElement('span'));

// Y.all NodeList method:
spans = Y.all(document.getElementsByTagName('span'));
// or
// spans = new Y.NodeList(document.getElementsByTagName('span'));

Convert YUI node to DOM Element:

Using Y.Node.getDOMNode(), we get the DOM element.

Y.Node.getDOMNode(Y.one('#id)) //returns the DOM node with the given id