Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
YUI: pass in raw node OR id in YUI 3
var getNode = function(el) {
//fetch the node by selector, or wrap it in a new YUI Node instance
return Y.one('#' + el) || new Y.Node(el);
};
//from http://stackoverflow.com/questions/4892051/how-can-i-normalise-a-javascript-object-to-a-dom-element-with-yui3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment