Dropdown box with id "drpGender" :
Click Here
to alert value selected from dropdown box with id : "drpGender"
Code:
alert($('#drpGender').val());
Click
Here to alert text selected from dropdown box with id : "drpGender"
Code:
alert($('#drpGender>option:selected').text());
As we know asp.net assigns unique id to controls at page generation time.
jQuery's selector using attribute will help us to find out exact control
Here we have asp.net textbox with id : "txtServerTextBox"
Click
Here to alert value selected from input box with id : "txtName"
Code:
alert('Hello ' + $('input[id$="txtServerTextBox"]').val() + ' !!');
Please visit
http://docs.jquery.com/Selectors for more details.