jQuery get the selected dropdown value on change
val
is a method, not a property.
use it like val()
If you are using it many places, i would assign it to a local variable and use it thereafter.
Also you can use the $.now()
function to get the unique time stamp. It is equal to DategetTime();
$('.dropone').change(function() {
var item=$(this);
alert(item.val())
$(".droptwo").empty();
$(".droptwo").load("ajaxdropdown.aspx?drpType=room
&roomid=" +item.attr("value") + "&ts=" + $.now());
});
You must obtain the value using a method, not a property. Use this:
alert($(this).val())
$('.dropone').change(function() {
var val = $(this).val();
// OR
var val = this.value;
})