Bug Tracker

Ticket #6928: HTMLPage1.htm

File HTMLPage1.htm, 872 bytes (added by Shlomi, 4 years ago)

Demonstrates the problem.

Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD html 4.0 Transitional//EN">
2<html>
3<head>
4    <title>Untitled Page</title>
5    <script language="javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
6   
7    <script language="javascript">
8   
9    function InputOnKeyDown(objEvent)
10    {
11        var objMyDiv = $(window.document.getElementById("MyDiv"));
12        if(objMyDiv)
13        {
14            $(objMyDiv).keydown();
15        }
16    }
17   
18    function DivOnKeyDown(objEvent)
19    {
20        alert(objEvent.keyCode);
21    }
22   
23    </script>
24   
25</head>
26<body>
27    <input type="text" value="Enter keys..." onkeydown="InputOnKeyDown(event);" />
28   
29    <div onkeydown="DivOnKeyDown(event);" tabindex="-1" id="MyDiv" style="position:absolute;width:100px;height:100px;left:100px;top:100px;background-color:Green;" ></div>
30</body>
31</html>