As with most CSS attributes, you can access our two stars via JavaScript, by using the properties pageBreakBefore and pageBreakAfter. The obvious advantage of this is the ability to then dynamically assign their values. For example, instead of forcing custom page breaks on your visitors, you can create a script to make this optional. Here I’ll create a checkbox that toggles between slicing the page at the headers (h2) and at the printer’s own discretion (default):
<form name=“myform”>
<input type=“checkbox” name=“mybox” onClick=“breakeveryheader()”>
</form>
function breakeveryheader(){
var thestyle=(document.forms.myform.mybox.checked)? “always” : “auto”
for (i=0; i<document.getElementsByTagName(“H2”).length; i++)
document.getElementsByTagName(“H2”).style.pageBreakBefore=thestyle
}
______________________________________________________
Real Estate Nashville
Houses for sale