Unlike Javascript's native for loops, the body of an
element with a mjt.for= attribute creates a new
variable scope. Variables declared inside the body are not shared
across iterations of the loop: this works out very nicely when you
want to create an event handler for each item in a list.
When you do want to share a variable, you can declare it outside the
mjt.for="". Try View source on this page to see how the
buttons below are constructed:
var shared = 0;
shared++;