Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 478
Suave Nti Avatar asked Dec 27 '22 07:12

Suave Nti


1 Answers

This is shorter ;)

$("#<%=delButton.ClientID%>").val('InActivate');
like image 179
Alex Dn Avatar answered Jan 11 '23 22:01

Alex Dn