2010-09-09 111 views

回答

3

任何outerHTML插件,like this將工作:

jQuery.fn.outerHTML = function() { 
    return jQuery('<div />').append(this.clone()).html(); 
} 

然後,只需調用它,如:

var html = $("#input").outerHTML(); 

You can give it a try here,所有這些插件的使用基本上是相同的概念,克隆它,將其粘貼在容器中,獲取該容器的innerHTML。