192
rated 0 times
[
195]
[
3]
/ answers: 1 / hits: 26005
/ 11 Years ago, mon, october 7, 2013, 12:00:00
Here is my simple scenario. I have a variable defined inside the ready()
function which assigns the first value.
I also have a function outside ready()
. What I want to do is to use the changed variable inside my new function.
Here is my JavaScript code:
var myFunction = function() {
// I wanna change Vp value here and wanna
// use this function with the new value
Vp = new value;
myFunction2 ();
};
$(document).ready(function () {
var Vp = first value asign;
$('#btnAddCustomer').click(myFunction);
var myFunction2 = function() {
// I will use Vp variable here with new value
};
});
More From » jquery