Pass parameters to function called with addEventListener


  • I am trying to send some parameters to a function called with

    window.addEventListener("keyup", eventkeyup, false);

    function eventkeyup() {

    How can I send parameters to eventkeyup? If I try

    window.addEventListener("keyup", eventkeyup(something), false);

    function eventkeyup(something) {

    It overrwrites the original event parameter and I'm not able to detect key strokes, and

    window.addEventListener("keyup", eventkeyup(event, something), false);

    function eventkeyup(event, something) {

    doesn´'t send 'event' neither. How can I do it?

    Monday, October 21, 2013 3:03 PM