I have been trying to get my head around javascript increments, in particular I have been reading the info at http://www.webdevelopersnotes.com/tu...operators.php3
namely from the example
Code:
var a = 5;
b = a++;
(b contains the initial value of a, which is 5.
a, on the other hand is now equal to 6)
var a = 5;
c = ++a;
(In this case, JavaScript first adds 1 to a, changing
its value to 6. This value is returned to c.
Thus, c = 6)
But how do I get it to increment, so from the above (first part) if I call 'a' I get 6, which is fine, but if a is called again it is still 6 and not 7... how do I get a to be 6, 7 , 8 and so on?
Likewise in the second part, where c is returned as 6, how do I get it to return as 7 on the next call on the same list?
I am trying to learn...
Here is a sample of what I am trying to get to work
Code:
...this.classActive="dgst_active"+dgsx;this.classInActive="dgst_inactive"+dgsx;...
where 'dgsx' is the same as 'a' in the above example.
But all I get is the class all having the same number at the end instead of it incrementing
Bookmarks