0

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>

2 Answers 2

2

inside ButtonLogin_OnClick do

this.ButtonLogin.Attributes.Add("dojotype", "dijit.form.Button");
Sign up to request clarification or add additional context in comments.

Comments

0

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>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.