Is there a way to parse data to a function from the event listener ?
I have this:
div.addEventListener('mousedown',run(id),false);
function run(e,id){
console.log(id);
}
Thing is it executes straight away. The other problem is - if i want to parse the variable id
, and the run
function recieves e
for the event, how do you parse any thing else =/ It's a bit confusing to work out what order e
is (before or after your designated variables that you want to parse)
The current work around so far was to assign id
to window so its basically a global... but i'm wondering if parsing via the event is possible at all ?