首先我們可以把要列印的內容放在div中,然後用下面的程式碼列印。 複製代碼 代碼如下: <BR>function printdiv(printpage)<BR>{<BR>var headstr = "<html><head><title><body>";<BR>var footstr = "";<BR>var newstr = document.all.item(printpage).innerHTML;<BR>var oldstr = document.body.innerHTML;<BR>document.body.inininML = headstr newstr footstr;<BR>window.print(); <BR>document.body.innerHTML = oldstr;<BR>return false;<BR>}<BR>div print //HTML Page//Other content you wouldn't like to print The Div content which you want to print //Other content you wouldn't like to print//Other content you wouldn't like to print