If i assign a variable something like this
var a = $("input").val();
At the start of the program.
And then call something like this :
$("div").html(a);
Will this print the value of the value which was the value in the input when the var a = $("input").val(); was executed or when the line : $("div").html(a); was executed ?
The first line (
var a = $("input").val();) sets the value of a variable to whatever data is available. Later on when you use that variable (a), it will be the same value. It is only a string, it is not the actual DOM element.