listen events type in the js file