JavaScript Reference/Javascript Properties/altKey — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 08:22, 26 мая 2010
Содержание
"altKey" Example
<html>
<head>
<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>
"altKey" is applied to
+----------------+--------------------------------------------------------------+
| Applied_To |event |
+----------------+--------------------------------------------------------------+
"altKey" Possible Values
Possible Values
true
false.
"altKey" Syntax and Note
Note:
Read-only property.
Whether or not the ALT key is being held down.
Syntax:
window.event.altKey