Creating a Print Web Page Button
|
If you are looking for a way to create
a print web page button for your web site, this tip is for you.
You can enable your visitors to print out your web page using JavaScript.
Place the following JavaScript code within your HTML code where you would
like the button to appear:
<SCRIPT
LANGUAGE="JavaScript">
<!-- Begin
if (window.print) {
document.write('<form>'
+ '<input type="button" name="print" value="Print
This Page" '
+ 'onClick="javascript:window.print()"></form>');
}
// End -->
</SCRIPT> |
Change the text
indicated in red to the text that should appear on your print web page
button.
If you publish content, such as articles on your web site, this print page
button will provide a great way to enable your visitors to print your
content.
More Web Design
Tips |