Skip to content

Instantly share code, notes, and snippets.

@englishextra
Last active October 1, 2016 19:47
Show Gist options
  • Save englishextra/ad6b0ed6aa934434ddbb65d3a60ba28f to your computer and use it in GitHub Desktop.
Save englishextra/ad6b0ed6aa934434ddbb65d3a60ba28f to your computer and use it in GitHub Desktop.
Adds Element BEFORE NeighborElement
/*!
* Adds Element BEFORE NeighborElement
* gist.github.com/englishextra/ad6b0ed6aa934434ddbb65d3a60ba28f
* @param {String|object} e HTML Element to prepend before
* @param {Object} a target HTML Element
* prependBefore(e,a)
*/
var prependBefore=function(e,a){var p=a.parentNode||"";p&&p.insertBefore(e,a);return!1;};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment