document.getElementById('element').onclick = function(e){ alert('click'); }
演示:http://jsfiddle.net/e9jZW/1/