日期:2014-05-18 浏览次数:20439 次
function ap_clcik(c) { if (c!=null) { alert(c.value); } }
------解决方案--------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Test" %> <!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> </head> <body> <form id="form1" runat="server"> <div> <asp:TextBox ID="txtPageIndex" runat="server" /> </div> </form> </body> </html> <script type="text/jscript"> var box=document.getElementById('<%=txtPageIndex.UniqueID %>'); alert(box.value); </script>
------解决方案--------------------
getElementById 不是getElementsById
------解决方案--------------------