I think I see where you're going and it can be done as long as each heading has its relevant content within a corresponding DIV, with some sort of ID.
Example: (hand coded on the fly, not tested, but you'll get the gist)
- Code: Select all
<h2 id="SectionX" onclick="PrintSection(this)">Section X</h2>
<div id="SectionXContent"> blah blah blah </div>
<script>
function PrintSection(section){
var wind = window.open('about:blank');
var html = document.getElementById(section.id + 'Content').innerHTML;
wind.document.body.innerHTML = html;
wind.print();
}
</script>