I saw in StackOverflow and googling that the most used way to get selected text from a <SELECT> element with jquery is like this
$("#cboId :selected").text()
I have not an id, but an object. I have an object, let's say
var myCombo= $("#cboId");
based on the earlier part of the code.
I did it to get the selected text, but ugly:
$("#" + myCombo.attr('id') + " :selected").text() ;
is there a cleaner way to do this?
thanks.
javascript jquery select option
pomarc
source share