Hi how can i add attribute into a button when button is clicked?
this is the attribute dojotype="dijit.form.Button"
void ButtonLogin_OnClick(object sender, EventArgs e)
{
// the add attribute
}
this is my button
<button id="ButtonLogin" runat="server" onServerClick="ButtonLogin_OnClick" jsid="ButtonLogin" style="float: right;
padding: 5px 15px 0px 0px;">
Login</button>
在ButtonLogin_OnClick
里面做
this.ButtonLogin.Attributes.Add("dojotype", "dijit.form.Button");
You can do it by JQUERY. I'm adding attribute to "a" tag:
<a href="#" id="btnAttrib">Add Attrib</a>
<script type="text/javascript">
$("#btnAttrib").click(function () {
$("#btnAttrib").attr("rel", "nofollow");
})
</script>
I think you change it to:
<button id="ButtonLogin" runat="server" onServerClick="ButtonLogin_OnClick" jsid="ButtonLogin" style="float: right;padding: 5px 15px 0px 0px;">Login</button>
<script type="text/javascript">
$("#ButtonLogin").click(function () {
$("#ButtonLogin").attr("dojotype", "dijit.form.Button");
})
</script>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.