What is wrong in this Javascript function?
/*** Adds event listeners* @param {string} id element's id* @param {function} callback function to be run on click* @param {string} eventType defaults to click, but can be any event type*/const addListener = (id, callback, eventType = 'click') => {document.getElementsById(id).addEventListener(eventType, callback);};
Any help is appreciated!!
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here