自動獲得焦點
txt.focus();
自動選擇
txt.select();
離開焦點方法
$("txt").onblur = function () {xxxxxx}
得到焦點方法
$("txt").onfocus = function () {xxxxxx}
下拉菜單的事件
sele.onchange = function(){
switch (this.value) {
case "1" :
document.body.style.backgroundImage = "url(imags/xxx.png)";
break;
case "2" :
doucument.body.style.backgroundImage = "url(images/xxx.png)";
break;
}
}