62,268
社区成员
发帖
与我相关
我的任务
分享
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Ajax.aspx.cs" Inherits="AJAXEnabledWebApplication1.Ajax" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script type="text/javascript" src="jquery-1.3.2.js" >
</script>
<script type="text/javascript">
function aaa()
{
var s=$("#t1");
alert(s.value);
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="t1" runat="server" Text="aaaaaaaaaaaaaa"></asp:TextBox>
<asp:Label ID="l1" runat="server" Text="Label"></asp:Label>
<input type="button" onclick="aaa();" />
</div>
</form>
</body>
</html>
function aaa()
{
var s=$("#<%=t1.ClientID%>");
alert(s.val());
}
function aaa()
{
var s=$("#<%=t1.ClientID%>");
alert(s.value);
}