用Visual Studio 2010 C# 寫了一個網頁來測試Enter模擬Tab的功能,可是我發現IE執行上沒問題Chrome就不行 有辦法可以解決嗎?
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default_TEST1.aspx.cs" Inherits="Default_TEST1" %>
<!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></title>
<script type="text/javascript">
function tabchange() {
if (event.keyCode == 13) {
event.keyCode = 9;
return event.keyCode;
}
}
function setStyle(x) {
document.getElementById(x).style.background = "#FFCCFF"
}
function freeStyle(x) {
document.getElementById(x).style.background = "white"
}
</script>
<style type="text/css">
.style3
{
width: 10px;
}
</style>
</head>
<body onkeydown="tabchange()">
<form id="form1" runat="server">
<div>
<asp:Panel ID="Panel1" runat="server" Height="349px">
<table style="width:100%;" bgcolor="#FFFFCC">
<tr>
<td>
<asp:Label ID="LabelID" runat="server" Text=""></asp:Label>
<asp:TextBox ID="TextBox1" runat="server" ontextchanged="TextBox1_TextChanged"></asp:TextBox>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
<asp:CheckBox ID="CheckBox1" runat="server" />
</td>
<td class="style3">
</td>
<td>
</td>
</tr>
</table>
<table style="width:100%;" bgcolor="#FFFFCC">
<tr>
This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers. Five Filters recommends: 'You Say What You Like, Because They Like What You Say' - http://www.medialens.org/index.php/alerts/alert-archive/alerts-2013/731-you-say-what-you-like-because-they-like-what-you-say.html