Well, since all clicking on that button does is call the sudoku() function, why not simply call the function directly?
I would *GUESS* that the reason it doesn't work is because you are trying to invoke an EVENT on the button object but the current event handler (namely, the existing call to sudoku function) has not yet completed. Surely has something to do with how events are rendered in the DOM. Remember: Invoking an event is not the same thing as simply calling a function. All the event *handlers* that are registered for that event have to be checked and invoked. Even if there is only the one, all the event handling logic still has to be dealt with.
Again, this is pure guess on my part. But I can't see why you need to invoke the event if the real purpose is just to call sudoku() again.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.