Guest User

Untitled

a guest
Jan 16th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. function wrap(top, selector, bottom){
  2. var matches = document.querySelectorAll(selector);
  3. for (var i = 0; i < matches.length; i++){
  4. var modified = top + matches[i].outerHTML + bottom;
  5. matches[i].outerHTML = modified;
  6. }
  7. }
  8.  
  9. wrap("<div class='wrapper'>", ".getWrapped", "</div>");
Add Comment
Please, Sign In to add comment