i have a.html which is
a.html
<script>
function printContent(el){
var restorepage = document.body.innerHTML;
var printcontent = document.getElementById(el).innerHTML;
document.body.innerHTML = printcontent;
window.print();
document.body.innerHTML = restorepage;
}
</script>
<div id="div1">DIV 1 content...</div>
<button onclick="printContent('div1')">Print Content</button>
i want to print contain in a.html which the button is in b.html
b.html
<a href="#" onclick="printContent("printJS")">Print</a>
How to pass the func to other file?
thanks