input框完全改变后获取,可以用change事件;
input框实时数据获取,可在获取焦点后,绑定keyup函数;
select框选定元素的获取及改变后值的获取,在下面的例子中也有体现。
$(document).ready(function(){
//get the map 时租
/*
var up_city0 = $("#up_city_0 option:selected").html();
$('#up_city_0').change(function(){
//alert($(this).children('option:selected').text());
up_city0 = $(this).children('option:selected').html();
})
$("#up_location_0").focus(function(){
$(this).bind("keyup", function(){
var up_place0 = up_city0 + $(this).val();
//alert(up_place0);
$("#mapframe").attr('src','mapframe.php?place='+up_place0);
});
});*/
var up_city0 = $("#up_city_0 option:selected").html();
$('#up_city_0').change(function(){
//alert($(this).children('option:selected').text());
up_city0 = $(this).children('option:selected').html();
})
$("#up_location_0").change(function(){
var up_place0 = up_city0 + $(this).val();
//alert(up_place0);
$("#mapframe").attr('src','mapframe.php?place='+up_place0);
});
})