"; var printData = $(".article").innerHTML;// 獲得 div 里的所有 html 數據 var oldstr = document.body.innerHTML; document.body.innerHTML = headstr+printData+footstr; window.print(); document.body.innerHTML = oldstr; return false; }