jqueryaspbutton

Changing Text of asp:Button using Jquery


Am trying to change text of an asp:Button using jQuery Like this

  $("#<%=delButton.ClientID%>").attr('text', 'InActivate');
  .....
  <asp:Button ID="delButton" runat="server" UseSubmitBehavior="false" Text="Activate "    
   CssClass="button"   ToolTip="" OnClientClick="ondel();return false;"/>

I can see the text changing, Is the proper way to do?

Thanks


Solution

  • This is shorter ;)

    $("#<%=delButton.ClientID%>").val('InActivate');