JavaScript事件方法(实例讲解)
废话不多说,直接上代码
div{ background-color:lightblue; margin:5px; padding:5px; } varchangeSize=function(){ varoTxt=document.getElementById('txt'); oTxt.size+=5; } varshowMessage=function(){ alert('单击事件'); alert('事件类型:'+event.type); } window.onload=function(){ document.getElementById('btn1').onclick= function(){ alert('btn1单击事件'); } } 只有三次抽奖机会!
您是第"+times+"次抽奖,抽中的是:"+arr[n]+"
" }