I defined a function to change the elements attribute.
I want to pass an argument to this function in 'addEventListener' and this is my problem.
Here is the function :
function collapse (el) {
var _cl = el.classList;
_cl.add("box_size1");
el.removeAttribute("id");
}
Here is main code :
window.onload = function() {
var el = document.getElementById("box_size2");
el.addEventListener("click", collapse(???));
}
what shall I write instead of question marks ?