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)
}

Pas de solution correcte

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top