<a title="Print Screen" alt="Print Screen" onclick="window.print();" target="_blank" style="cursor:pointer;">CLICK HERE TO PRINT FORM!</a>
-
You can use css to change the look also choose to use – Kartic Mar 10 '15 at 18:19
5 Answers
use the button tag :
<button onclick="window.print();">CLICK HERE TO PRINT FORM!</button>

- 754
- 11
- 21
You are using a hyper link. You need to use a button instead.
<input type="button" name="Print Screen" value = "CLICK HERE TO PRINT FORM!" onclick="window.print();" target="_blank" style="cursor:pointer;"/>
To create a button you have to use the button tag instead of <a/>
( <button />
)

- 103
- 8
-
Just so you know you can use a ` symbol to make this answer clearer or use four spaces as this is code. As is, the `a` can be confused to not mean the `` html tag – KHeaney Mar 10 '15 at 18:35
Something you may not want to hear is that I would possibly prefer this to be a hyperlink since it navigates to a new tab and utilizes the target="_blank"
This link has a guide to when to use a button or a hyperlink near the middle of the article. http://www.karlgroves.com/2013/05/14/links-are-not-buttons-neither-are-divs-and-spans/
mayankTUM beat me to the next part of my answer which he was faster at writing. This would be a more proper solution per your request by using <input type="button" />
. His syntax works and fulfills your requirements.

- 120
- 1
- 8
This is what I use recently. The (.5) means 50% if you leave it as () it is 100%
<a button onclick=window.print(.5) class="btn"> print </a>

- 118,664
- 26
- 252
- 242