<html>
<head>
<script>
function setPageBreak()
{
document.getElementById("footer").style.pageBreakAfter="always";
}
</script>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
<p id="footer">This is a footer paragraph.</p>
<button type="button" onclick="setPageBreak()">Set page-break after footer paragraph</button>
<p>Click the button above and see the changes in print or print preview.</p>
</body>
</html>