Impression d'une partie de page html

Résolu
Bonjour, en recherchant sur la toile des script pour l'impression de mes pages, je suis tombé sur ce code. il marche mais j'aimerai que l'aperçu de la page à imprimer s'ouvre dans une nouvelle page (si possible un pop-up).
pouvez vous m'aider?

<script language="JavaScript" type="text/JavaScript">
function doPrint() {
bdhtml=window.document.body.innerHTML;
sprnstr="<!--startprint-->";
eprnstr="<!--endprint-->";
prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17);
prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));
window.document.body.innerHTML=prnhtml;
window.print();
}
</script>

Code HTML:
<!--startprint-->
This area will print!
<!--endprint-->
<br />
I will not print?
<input id="btnPrint" type="button" value="Print" onclick="doPrint()" />

1 réponse

  1. personne pour m'aider?
    0
    1. ya t -il personne pour repndre a ce message?
      0