<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Events !</title>
<script type="text/javascript">
window.onload = function() {
[B]//Only this occurs[/B]
document.getElementById('anImage').onclick = function() {
alert('F-14 Tomcat !');
}
[B]//This gives the result of the first[/B]
document.getElementById('anImage').ondblclick = function() {
alert('Not again ! !');
}
[B]//Nothing happens!!!![/B]
document.getElementById('anImage').onkeydown = function() {
alert('Please !');
}
};
</script>
<style type="text/css">
#anImage
{
height: 300px;
width: 372px;
}
</style>
</head>
<body>
<img src="1012562.jpg" id="anImage" />
</body>
</html>
Why is that only the first event occurs ??
Please help !