I have the following select options:
<select id="optionA">
<option> A </option>
<option> B </option>
<option> C </option>
</select>
<select id="optionB">
<option> D </option>
<option> E </option>
<option> F </option>
</select>
The following jquery code is not working to determine the text values of each selected options:
<script type="text/javascript">
$(document).ready(function()
{
if($("#optionA").change() || ($("#optionB").change())
{
var textA = $(this).find("#optionA option:selected").text();
var textB = $(this).find("#optionB option:selected").text();
alert( + textA + " " + textB);
}
});
</script>
Any idea what might be the problem?
http://jsfiddle.net/upZKt/1/