01.
<script type=
"text/javascript"
>
02.
03.
function
printSelection(node){
04.
05.
var
content=node.innerHTML
06.
var
pwin=window.open(
'print.asp'
);
07.
var
cStyls = document.getElementsByTagName(
'stylesheet'
)
08.
09.
pwin.document.open();
10.
pwin.document.write(
'<html><body onload="window.print()">'
+content+
'</body></html>'
);
11.
pwin.document.close();
12.
13.
setTimeout(
function
(){pwin.close();},10000);
14.
15.
}
16.
</script>
17.
18.
<div id=
"tab1"
>
19.
content
20.
</div>
21.
22.
<input name=
"button6"
type=
"image"
src=
"img_jpeg/spry/print.jpg"
width=
"27"
height=
"23"
id=
"button7"
value=
"พิมพ์เอกสาร"
valign=
"right"
onClick=
"printSelection(document.getElementById('tab1'));return false"
/>