I thought this was easy because it's easy to get the selected value from
a dropdown but i ended up doing something like this
$('#dropdown').change(function(){
$.log($(this).find('option').filter(':selected').text());
});
Is there another way to get the text?
--
David
David Duymelinck schrieb:
I thought this was easy because it's easy to get the selected value from
a dropdown but i ended up doing something like this
$('#dropdown').change(function(){
$.log($(this).find('option').filter(':selected').text());
});
Is there another way
Klaus Hartl schreef:
I can only imagine to make that a little shorter:
$('#dropdown').change(function() {
$.log( $('option:selected', this).text() );
});
A little is good enough for me :) thank you
--
David Duymelinck
[EMAIL PROTECTED]
I can only imagine to make that a little shorter:
$('#dropdown').change(function() {
$.log( $('option:selected', this).text() );
});
I could imagine making it faster :-)
$('#dropdown').change(function() {
$.log(this.options[this.selectedIndex].text);
});