I am opening a screen in a new window to print. This works great. Unfortunately the links are still live and causing problems with users clicking on them and causing errors.
My question is how can I turn off links with javascript?
Thanks
| SitePoint Sponsor |
I am opening a screen in a new window to print. This works great. Unfortunately the links are still live and causing problems with users clicking on them and causing errors.
My question is how can I turn off links with javascript?
Thanks




Code:{ var a=newwindow.document.links, L=a.length; for(var i=0;i<L;i++){ a[i].disabled='disabled'; }





Some options are
1) change the display style of the links to 'none'
2) set the disabled property of the links to true.

Why are you using the 20th century method of having a separate version for print rather than just using a print stylesheet with the original page?
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
Bookmarks