Skip to content

Instantly share code, notes, and snippets.

@vnys
Last active August 29, 2015 14:11
Show Gist options
  • Save vnys/8f73faa512ad21be9f1f to your computer and use it in GitHub Desktop.
Save vnys/8f73faa512ad21be9f1f to your computer and use it in GitHub Desktop.
Bondage (bind lib)
var tag = document.createElement.bind(document),
txt = document.createTextNode.bind(document),
get = document.querySelector.bind(document),
getall = document.querySelectorAll.bind(document),
log = console.log.bind(console);
var div = tag('div');
div.appendChild(txt('tjobing'));
log(div);
var anotherDiv = get('div');
var aBunchOfDivs = getall('div');
@vnys
Copy link
Author

vnys commented Dec 11, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment