Gente al hacer click en un boton hago lo siguiente agrego un boton de tipo file lo que no puedo hacer es darle un onclik o un onchange todo lo demas lo hace bien como decirle de que type es su nombre y id
Código HTML:
ele = document.createElement('input'); // creo un input
ele.type = 'file';
ele.onchange='unafuncion()';//este no me lo agrega
ele.name = 'foto';
ele.id = 'foto6'
//despues lo agrego al boton
como hago para ponerle evento a un boton como un onclick o onchange