Skip to content

Instantly share code, notes, and snippets.

@Sigmus
Created July 21, 2014 21:36
Show Gist options
  • Save Sigmus/85c6a79d275827fded3e to your computer and use it in GitHub Desktop.
Save Sigmus/85c6a79d275827fded3e to your computer and use it in GitHub Desktop.
A small module that replaces it's parent element content with the provided html.
var _ = require('lodash');
module.exports = _.curry(replaceParent, 2);
function replaceParent(element, html) {
var parent = element.parentNode;
parent.innerHTML = html;
return parent;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment