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 ,