Eric Saboia Eric Saboia - 1 year ago 70
jQuery Question

How to get value of asp:Button with JavaScript

I don't understand very well how I get value of with JavaScript or JQuery?

I have this code:

<asp:Button ID="btnIdButton" runat="server" Text="Button"/>

In this case I need get value inside the button with id "btnIdButton". I tested some possibilites:


But it did not work.

Answer Source

You need to use "endsWith" selector like this:$("[id$=btnIdButton]")

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download