js如何实现点击button更换text属性值 js如何实现点击button更换text属性值,也就是按钮的值,第一次点button按钮是什么文字,第二次是什么,这样我要用服务器端button去点击,不是用html的<input>这样的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 $('#<%= btn_save.ClientID %>').click(function(){$(this).text('mysave');}); 声明一个js变量,用于保存是第几次点击然后写一个js函数ChangeBtnText()然后给服务器的按钮加一个js脚本,如下:btn.Attributes.Add("onclick","ChangeBtnText()") < asp:button runat="server" onclientclick="value=value+'点'" /> 我的是这样的,但是我想用button服务器的去调用它,而不是html的 var count=0; function addcomple() { count++; var r=document.getElementById("Button1"); if(count==1) { r.value="111"; } else if(count ==2) { r.value="2222"; } else if(count==3) { r.value="44444"; } else { r.value="333"; } =.=!服务器控件加载到HTML的时候也会被解释成html代码啊不然浏览器不识别=。=!老提服务器控件有啥特殊含义呢? <html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>无标题页</title> <script type="text/javascript"> function clickme() { var a = document.getElementById('<%=Button1.ClientID %>').value ="aaaa"; return false; } </script></head><body> <form id="form1" runat="server"> <div> <asp:Button ID="Button1" runat="server" Text="dddd" OnClientClick="return clickme();" /> </div> </form></body></html>//正确 加一个runat="server" 不就成了服务器控件了<input type="button" ID="Button1" runat="server" value="你在" onclick="value=value+'点'" /> 不是用html的<input>......<input type="button" ID="Button1" runat="server" value="你在" onclick="value=value+'点'" />楼主,你说这个是不是服务器控件?楼主的IE能认识<asp:Button >这种的东西? 还不是要翻译过去的 我想匹配几个固定的网址该如何的呢? 请详细解释下程序设计七层结构的含义 datagrid问题 用datagridview怎样从数据库中取得图片并显示?? IList<DutyInfo> DutyDate = new List<DutyInfo>();这种类型的值要怎么用啊 在线急等!!!!大家帮忙!如何将多个表查询出来的信息,综合显示出来?? 哪里有便宜点的空间和域名呀? 水晶报表问题:不能显示生成的统计图,只能显示文字 关于搜索的问题: 这样为什么画不出来啊 SQLSERVER计算时间差 aspx中的异步处理
{
$(this).text('mysave');
});
btn.Attributes.Add("onclick","ChangeBtnText()")
< asp:button runat="server" onclientclick="value=value+'点'" />
function addcomple()
{
count++;
var r=document.getElementById("Button1");
if(count==1)
{
r.value="111";
}
else if(count ==2)
{
r.value="2222";
}
else if(count==3)
{
r.value="44444";
}
else
{
r.value="333";
}
<head runat="server">
<title>无标题页</title>
<script type="text/javascript">
function clickme()
{
var a = document.getElementById('<%=Button1.ClientID %>').value ="aaaa";
return false;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="dddd" OnClientClick="return clickme();" />
</div>
</form>
</body>
</html>//正确
<input type="button" ID="Button1" runat="server" value="你在" onclick="value=value+'点'" />
楼主,你说这个是不是服务器控件?楼主的IE能认识<asp:Button >这种的东西? 还不是要翻译过去的