I'm trying to change an onchange event, and I've got the code to do it and it's (almost) working, but I'm having a little problem with variables. Using this code:
c2.onchange = function onchange(event) { replaceWord(inc1, (i - 1), r, (total - 1)) };
The variables int1, i, r and total have all been declared in the script I'm using with the above line, the problem is that instead of setting the new function with the values those variables contain, it sets the variable's names as a literal string so "inc1" become the parameter. The code (of actually setting the new onchange function) works, as if I tried alert('hi') it would work fine.Any solutions to this?