Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes


JavaScript Programming

JavaScript > Code Examples

'altKey' Property

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
'altKey' Property <html> <head> <title>Happy Codings :-) Javascript Examples</title> <script language="JavaScript"> function function1() { var m = event.altKey; if (m == false) { alert("The Alt Key is not pressed"); document.all.myButton.value = "Click here while pressing the Alt key"; } else if(m == true) { alert("The Alt Key is pressed"); document.all.myButton.value = "Click here"; } } </script> </head> <body> <input id="myButton" type="button" value="Click here" onClick="function1();"> </body> </html>