I got the content to pop up into a new window, based on which button I chose, and then the pop-up window opens and just prints. Pretty ugly, for it to just pull up a new window just to print.
Is there a way for me to print a specific div, based off of the current code that I have?
[B][U]MainPage
[code=html]
<html>
<head>
<script type=”text/javascript”>
var contentHTML = “Couldn’t find Content”;
function popup(obj) {
var contentName = obj.parentNode.childNodes;
for (var i=5; i<contentName.length; i++) {
if (contentName[i].tagName != undefined) {
contentHTML = contentName[i].innerHTML;
break;
}
}
var winPopup = window.open(‘content.html’,”,’width=410,height=400,toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no’);
}
</script>
</head>
<body>
<div>
<div>content1</div>
<input type=”button” value=” print content1 ” onclick=”popup(this)”>
</div>
<br />
<br />
<div>
<div>content2</div>
<input type=”button” value=” print content2 ” onclick=”popup(this)”>
</div>
</body>
</html>
[B][U]Pop-Up Page
[code=html]<script type=”text/javascript” language=”JavaScript”>
function showIt() {
document.getElementById(‘coupon’).innerHTML = window.opener.couponHTML;
window.print();
}
</script>
So basically now I just want if this or that button is click that it print that specific div and not the entire page.
So if anyone can help, big thanks in advance.