2010-09-09 45 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。