Answer: Hi all,
First, include
jQuery in your application.
Drop a textbox in your .aspx page:-
<input id="inputField" type="text" size="12"/>
include a button also:-
<asp:Button ID="Button1" runat="server" Text="get"/>
Now, here's the script:-
<script type="text/javascript">
$(document).ready(function () {
$('#Button1').click(function () {
alert($('#inputField').attr("value"));
});
});
</script>
On the click of the button, an alert will be given containing the text in the text box.
I hope this helps......
Thanks and Regards
Akiii
Asked In: Many Interviews |
Alert Moderator