Created
February 19, 2021 19:34
-
-
Save matthewmorrone/318235d3724d1473376cf1adf522441f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (a) { | |
a.fn.replaceTag = function (f) { | |
var g = [], h = this.length; | |
while (h--) { | |
var k = document.createElement(f), b = this[h], d = b.attributes; | |
for (var c = d.length - 1; c >= 0; c--) { | |
var j = d[c]; | |
k.setAttribute(j.name, j.value) | |
} | |
k.innerHTML = b.innerHTML; | |
a(b).after(k).remove(); | |
g[h - 1] = k | |
} | |
return a(g) | |
} | |
})(window.jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment