<script>
window.onload=function(){
document.getElementById("div").onclick = function(){ alert('div'); };
}
</script>
<div id="div" style="border:1px solid blue; color:red; font-weight:700; cursor:pointer">div</div>
<script>
function Clk(a){
alert('div');
};
</script>
<div id="div" onclick="Clk(this)" style="border:1px solid blue; color:red; font-weight:700; cursor:pointer">div</div>