-1
<a title="Print Screen" alt="Print Screen" onclick="window.print();"    target="_blank" style="cursor:pointer;">CLICK HERE TO PRINT FORM!</a>
Ryan M
  • 18,333
  • 31
  • 67
  • 74
jhunter
  • 1
  • 1
  • 1
  • 3

5 Answers5

2

use the button tag :

<button onclick="window.print();">CLICK HERE TO PRINT FORM!</button>
Rod
  • 754
  • 11
  • 21
0

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;"/>
0

To create a button you have to use the button tag instead of <a/> ( <button /> )

FireRain
  • 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
0

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.

JKirkbride
  • 120
  • 1
  • 8
0

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>
Robert Longson
  • 118,664
  • 26
  • 252
  • 242