Skip to content

Instantly share code, notes, and snippets.

@0mg
Created March 28, 2012 06:29
Show Gist options
  • Save 0mg/2224241 to your computer and use it in GitHub Desktop.
Save 0mg/2224241 to your computer and use it in GitHub Desktop.
dom.js
var dom = {
ce: function ce(s) { return document.createElement(s); },
ct: function ct(s) { return document.createTextNode(s); },
cf: function cf() { return document.createDocumentFragment(); },
id: function id(s) { return document.getElementById(s); },
q: function q(s) { return document.querySelector(s); },
qs: function qs(s) { return document.querySelectorAll(s); },
rm: function rm(e) { return e.parentNode.removeChild(e); }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment