Skip to content

Instantly share code, notes, and snippets.

@jamischarles
Created February 14, 2011 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamischarles/826226 to your computer and use it in GitHub Desktop.
Save jamischarles/826226 to your computer and use it in GitHub Desktop.
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