Skip to content

Instantly share code, notes, and snippets.

@joshbeckman
Created October 1, 2013 20:21
Show Gist options
  • Save joshbeckman/6784495 to your computer and use it in GitHub Desktop.
Save joshbeckman/6784495 to your computer and use it in GitHub Desktop.
Simple replacement for the sequence of creating a DOM element and assign properties
var create = function(name, props){
var el = document.createElement(name);
for (var p in props) el[p] = props[p];
return el;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment