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>