The event object needs to be passed into js function.