Plugin jQuery externoHTML - Trucos CSS

Tabla de contenido

innerHTML () es nativo y devuelve el contenido de un nodo DOM (por ejemplo, I live inside a div.externalHTML () no lo es, lo que incluiría el nodo DOM actual (por ejemplo I live inside a div. ). Esta es una versión de jQuery encadenable para hacer eso.

$.fn.outerHTML = function()( // IE, Chrome & Safari will comply with the non-standard outerHTML, all others (FF) will have a fall-back for cloning return (!this.length) ? this : (this(0).outerHTML || ( function(el)( var div = document.createElement('div'); div.appendChild(el.cloneNode(true)); var contents = div.innerHTML; div = null; return contents; ))(this(0))); )

Articulos interesantes...