Code
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <HTML>
3 <HEAD>
4 <TITLE> New Document </TITLE>
5 <META NAME="Generator" CONTENT="EditPlus">
6 <META NAME="Author" CONTENT="">
7 <META NAME="Keywords" CONTENT="">
8 <META NAME="Description" CONTENT="">
9 <script language="javascript">
10 var rowint = 0; //只需要把document.all("divFilteContent").innerHTML = 生成所需要的table
11 function doclick()
12 {
13 if(event.keyCode == 40 )
14 {
15 if(document.all("hidContent").value == ""){document.all("hidContent").value=document.all("txtContent").value;}
16 if(rowint>0)
17 { tabContent.rows[rowint-1].style.background="";}
18 if(rowint<tabContent.rows.length)
19 {
20 tabContent.rows[rowint].style.background="#eeeeee";
21 document.all("txtContent").value = tabContent.rows[rowint].innerText;
22 }
23 if(rowint==tabContent.rows.length)
24 {
25 document.all("txtContent").value=document.all("hidContent").value;
26 tabContent.rows[rowint-1].style.background="";
27 rowint = -1;
28 }
29 rowint ++;
30 }
31 else if(event.keyCode == 38)
32 {
33 if(rowint>1)
34 {
35 rowint --;
36 tabContent.rows[rowint-1].style.background="#eeeeee";
37 document.all("txtContent").value = tabContent.rows[rowint-1].innerText;
38 if(rowint>0) { tabContent.rows[rowint].style.background="";}
39 }
40 }
41 }
42 </script>
43
44 </HEAD>
45
46 <BODY onkeydown="doclick();">
47 <div>
48 <input type="text" id= "txtContent" width="260px" ><input type="hidden" id="hidContent">
49 </div>
50
51 <div id = "divFilteContent">
52 <table id="tabContent" width="151" style="border-left: 1px solid grid; border-right: 1px solid grid;border-bottom: 1px solid grid;" cellpadding="0" cellspacing="0">
53 <tr>
54 <td>1</td>
55 </tr>
56 <tr>
57 <td>2</td>
58 </tr>
59 <tr>
60 <td>3</td>
61 </tr>
62 <tr>
63 <td>4</td>
64 </tr>
65 </table>
66 </div>
67 </BODY>
68 </HTML>
69
70
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <HTML>
3 <HEAD>
4 <TITLE> New Document </TITLE>
5 <META NAME="Generator" CONTENT="EditPlus">
6 <META NAME="Author" CONTENT="">
7 <META NAME="Keywords" CONTENT="">
8 <META NAME="Description" CONTENT="">
9 <script language="javascript">
10 var rowint = 0; //只需要把document.all("divFilteContent").innerHTML = 生成所需要的table
11 function doclick()
12 {
13 if(event.keyCode == 40 )
14 {
15 if(document.all("hidContent").value == ""){document.all("hidContent").value=document.all("txtContent").value;}
16 if(rowint>0)
17 { tabContent.rows[rowint-1].style.background="";}
18 if(rowint<tabContent.rows.length)
19 {
20 tabContent.rows[rowint].style.background="#eeeeee";
21 document.all("txtContent").value = tabContent.rows[rowint].innerText;
22 }
23 if(rowint==tabContent.rows.length)
24 {
25 document.all("txtContent").value=document.all("hidContent").value;
26 tabContent.rows[rowint-1].style.background="";
27 rowint = -1;
28 }
29 rowint ++;
30 }
31 else if(event.keyCode == 38)
32 {
33 if(rowint>1)
34 {
35 rowint --;
36 tabContent.rows[rowint-1].style.background="#eeeeee";
37 document.all("txtContent").value = tabContent.rows[rowint-1].innerText;
38 if(rowint>0) { tabContent.rows[rowint].style.background="";}
39 }
40 }
41 }
42 </script>
43
44 </HEAD>
45
46 <BODY onkeydown="doclick();">
47 <div>
48 <input type="text" id= "txtContent" width="260px" ><input type="hidden" id="hidContent">
49 </div>
50
51 <div id = "divFilteContent">
52 <table id="tabContent" width="151" style="border-left: 1px solid grid; border-right: 1px solid grid;border-bottom: 1px solid grid;" cellpadding="0" cellspacing="0">
53 <tr>
54 <td>1</td>
55 </tr>
56 <tr>
57 <td>2</td>
58 </tr>
59 <tr>
60 <td>3</td>
61 </tr>
62 <tr>
63 <td>4</td>
64 </tr>
65 </table>
66 </div>
67 </BODY>
68 </HTML>
69
70