var elem=document.getElementById('el'); function fn(a){alert(a);} elem.addEventListener('click', function(){ fn('txt'); }, false);