Do variables that are references not automatically update?
On
http://learn.jquery.com/using-jquery-core/css-styling-dimensions/, I'm trying out this simple code:
$(document).ready(function(){
var h1Get = $("h1").css("font-size");
console.log(h1Get);
$("h1").css("font-size", "36px");
console.log(h1Get);
});
The first time
h1Get
is logged, it displays the original, correct font size. However the second time it does not get updated even though the actual font size updates to 36px. If I do
console.log(
$("h1").css("font-size")
);
then it is logged as
"36px".
Does this have to do because there are no functions updating the variable, or what exactly is going on?