var elem=document.getElementById('el'); function fn(a){alert(a);} elem.addEventListener('click', function(){ fn('txt'); }, false);
<html> <head> <meta charset='utf-8' /> <title></title> <script type='text/javascript'> </script> </head><body> <div id='el'> dfasdfasdf </div> <script type='text/javascript'> var elem=document.getElementById('el'); function fn(a){alert(a);} elem.addEventListener('click', function(){ fn('txt'); }, false); </script> </body> </html>