var xhtml = document.getElementById("__tip__script").outerHTML;
var xhtml = $("#__tip__script")[0].outerHTML;
var xhtml = $("#__tip__script").prop("outerHTML");
上面三者的取值完全相同
outerHTML.html*{
margin:5px;
}
function get_outerHTML() {
var xhtml=document.getElementById("__tip__script");
//var xhtml=$("#__tip__script")[0];
console.log(xhtml);
var _html=xhtml.outerHTML;
console.log(_html);
}
function set_outerHTML() {
var xhtml="
//consol
document.getElementById("__tip__script").outerHTML=xhtml;
get_outerHTML();
}
function get_jquery_prop() {
var xhtml = $("#__tip__script").prop("outerHTML");
console.log(xhtml);
}
function set_jquery_prop() {
var xhtml = $("#__tip__script").prop("outerHTML");
console.log(xhtml);
}