Java Reference
In-Depth Information
Gets the Unicode keycode associated with the key that caused the
event
keyCode
Gets or sets the return value from the event
returnValue
Indicates where in the browser window, in horizontal coordinates
relative to the origin in the screen coordinates, the mouse pointer
was when the event was generated
screenX
Indicates where in the browser window, in vertical coordinates
relative to the origin in the screen coordinates, the mouse pointer
was when the event was generated
screenY
Indicates whether the Shift key was pressed when the event was
generated
shiftKey
Gets the element object that caused the event
srcElement
Gets the element object that the mouse pointer is entering
toElement
Retrieves the event's name
type
Let's revisit some previous examples and make them work exclusively in old‐IE.
adding and removing Multiple Event handlers in Old‐IE
trY it out
In this Try It Out, you rewrite ch10_example7.html to use old‐IE's attachEvent() and detachEvent()
methods. Type in the following code:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Chapter 10: Example 11</title>
</head>
<body>
<img id="img0" src="usa.gif" />
<div id="status"></div>
<script>
var myImages = [
"usa.gif",
"canada.gif",
"jamaica.gif",
"mexico.gif"
];
function changeImg(e) {
var el = e.srcElement;
Search WWH ::




Custom Search