<html>
<head>
<script>
function setPageBreak()
{
document.getElementById("footer").style.pageBreakInside="avoid";
}
</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()">Avoid page-break inside footer paragraph</button>
</body>
</html>