Is there a Zepto equivalent for outerHTML?
-
01-07-2021 - |
Question
I haven't been able to find a Zepto equivalent for outerHTML so I wrote my own function.
Is there a better way? My function is working for me but if there is a "right" way to do this, I would prefer that.
function outerHTML(node){
return node.outerHTML || (function(n){
var nodeClone = $(node).clone(),
html = nodeClone[0],
placeholder = nodeClone.prev();
return $(node)})(node)
}
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow