fixing a variable's value in a function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rubenhan
    New Member
    • Dec 2008
    • 7

    fixing a variable's value in a function

    Hi,

    I would like to assign an integer to a add() through a variable. So I initially wrote this.


    Code:
    var i=0;
    name.onblur = function {add(i)};
    i++;
    if I created like 4 add(i), then i = 3. Then, if I onblur my first add(i), which I want it to be add(0);, it will instead add(3).

    In other words, how do I make sure I put a permanent value into a function through a variable?

    I hope I'm clear enough.

    Thank you.
    Reply With Quote
Working...