<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<title>print af bestemt div</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript" type="text/javascript">
function printPage(){
if(document.all&&navigator.userAgent.indexOf("Opera")==-1){
h=400;
w=600;
winTop=(screen.height - h - 100) / 2;
winLeft=(screen.width - w) / 2;
features="height="+h+",width="+w+",top="+winTop+",left="+winLeft+",toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no,titlebar=no";
strTitel=document.title;
divs=document.forms[0].elements;
var strContent="";
for(i=0;i<divs.length;i++){
strContent+=(divs[i].checked)?document.getElementById("div"+divs[i].value).innerHTML:"";
}
var doc="<html>\n";
doc+="<head>\n";
doc+="<title>Print Side\133"+strTitel+"\135<\57title>\n";
doc+="<\57head>\n";
doc+="<body>\n";
doc+=strContent+"\n";
doc+="<\57body>\n";
doc+="<\57html>\n";
newWin=window.open("","printWin",features);
newWin.document.write(doc);
newWin.document.close();
newWin.focus();
//newWin.print();
//newWin.close();
}
else{
window.print();
}
}
</script>
</head>
<body>
<form action="" method="get">
<input type="checkbox" value="1" name="1">
<input type="checkbox" value="2" name="2">
<input type="checkbox" value="3" name="3">
<input type="checkbox" value="4" name="4">
<input type="checkbox" value="5" name="5">
<input name="Print" type="button" value="Print" onClick="printPage();">
</form>
<div id="div1">
alt a
</div>
<div id="div2">
alt b
</div>
<div id="div3">
alt c
</div>
<div id="div4">
alt d
</div>
<div id="div5">
alt e
</div>
</body>
</html>