I want to create a div with an onclick event handler like
element.innerHTML = '<div onclick="somefunction(e, 10)"></div>';
where e would be the event object and 10 is some other random argument. I can't seem to find a way to do this. Is it possible?
Note that I do not want to create and then append the child to the parent element separately.