Discussion on:

Message 4 of 5
-1 Votes
+ -
You don't have var quite right.
Using var gives you local scope if you are in a function, otherwise it gives you global scope:

var test01 = 2; // global

function test() {
var test02 = 2; // local
test03 = 3; // global
test01 = test01 + 1;
test02 = test02 + 1;

$("#par01").html(test01);
$("#par02").html(test02);
}
Posted by charliecalvert
16th Dec