Correct the js event snippets which mistake the word "function"