当前位置:编程学习 > JAVA >>

javascript中获得焦点onfocus与失去焦点onblur

 

 

 

 

 

javascript中获得焦点onfocus与失去焦点onblur

2010年10月12日星期二 下午01:43

 

<html>
<head>
<script language="javascript">
window. function(){
var oName = document.getElementById('sd');

     oName.onfocus = function(){
       oName.value='';
     };

     oName.onblur = function(oEvent){
     var oTarget;
     if(window.event) oEvent = window.event;
      if(oEvent.srcElement)
             oTarget=oEvent.srcElement;
      else 
        oTarget = oEvent.target;
oTarget.value='lll';

};

};
</script>
补充:web前端 , JavaScript ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,