I am facing very weird issue. I have a dropdown option
<table class="variations">
<tr>
<td>
<select name="up_options">
<option value="" selected>Select Value</option>
<option value="a">A</option>
<option value="b">B</option>
<option value="c">C</option>
<option value="d">D</option>
<option value="e">E</option>
</select>
</td>
</tr>
</table>
and make a jquery function that alerts me the selected value but it did not work.
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('.variations select').change(function(){
alert(jQuery('.single_variation').text());
});
});
</script>
But when i edit the change
to click
it works perfectly (perfectly means it works only on click) when i click on select it gives me alert ... But when i change again it to change
its not work.
I also try this
<script type="text/javascript">
jQuery(document).ready(function(e) {
jQuery('.variations select').on('change', function(){
alert(jQuery('.single_variation').text());
});
});
</script>
But it also not work.
Please help me i am very confuse about it