90
rated 0 times
[
97]
[
7]
/ answers: 1 / hits: 73339
/ 13 Years ago, tue, april 5, 2011, 12:00:00
How can I set a Global Variable from within a function?
$(document).ready(function() {
var option = '';
$([name=select_option_selected]).change(function() {
var option = $(this).val();
alert(option); // Example: Foo
});
alert(option); // Need it to alert Foo from the above change function
});
More From » jquery