View Full Version : Make a button trigger the javascript:window.print()

01-14-2013, 02:46 PM
1) Script Title: Featured Content Slider v

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/featuredcontentslider.htm

3) Describe problem:

Hello! I am trying to make a button, once clicked, will trigger the browser based print using: the javascript: javascript:window.print()
I tried doing this:

<div class="contentdiv" onclick='javascript:window.print()'> </div>

But will work only if I click the div under the button.

What I wish is the button actually.

Just in case I Attached the .js file I am currently using(since I added some features I also found here at the forum).

Thanks in advance and more power.


01-14-2013, 03:06 PM
<input type="button" onclick="window.print();" value="Print">


<a href="javascript:print();" onclick="window.print(); return false;">Print</a>


<a href="javascript:print();" onclick="window.print(); return false;"><img src="print.gif" alt="" style="border-width: 0"></a>