<script language="JavaScript"> function function1() { document.all.myL.media = "print"; } </script> <a id="myL" href="" onClick="return false" media="screen">Some link</a> <input type="button" id="myB" onClick="function1();" value='Change the output media to "print"'> </body> </html>