$("#selected_mode").change( function() {var mode = $(this).val();});
var mode; $("#selected_mode").change( function() {mode = $(this).val();});
var mode; $("select[name='obj']").change( function() { mode = $(this).val(); }); $("#m-obj").attr("value", mode);