日期:2014-05-18 浏览次数:20500 次
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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 change(id) {
if (id && document.getElementById) {
var item = document.getElementById(id);
item.innerHTML = 'Modified Label';
}
}
</script>
</head>
<body>
<label id='name' for='item'>Some label</label>
<input id='item' type='button' value='Some value' onclick='change("name")' />
</body>
</html>
------解决方案--------------------
<asp:Label id="userName" class ="regLabel">由4~20个字母或数字组成.不支持中文,不能以数字开头 </asp:Label>
试一下
------解决方案--------------------
alert(userName);
看看userName是否为object