事件处理函数OnEnter OnExit 使用一例

[入库:2005年8月18日] [更新:2007年3月25日]

本文简介:选择自 nba23 的 blog

只留一个输入框空缺

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>onenter onexit 使用一例</title>
<style>
.in{
border-right: black 1px solid; border-top: black 1px solid; font-size: 9pt; border-left: black 1px solid; color: #000000; border-bottom: black 1px solid; height: 17px; background-color: #e4e4e4;
    }
</style>
<script language=javascript>
<!--
function onenter( field ) { if( field.value == field.defaultvalue ) { field.value = ""; } }
function onexit( field ) { if( field.value == "" ) { field.value = field.defaultvalue; } }
-->
</script>
</head>
<body>
<table>
  <td>
    <input  onblur=onexit(this)  class="in" onfocus=onenter(this) value=express>
    <input  onblur=onexit(this)  class="in" onfocus=onenter(this) value=express>
    <input  onblur=onexit(this)  class="in" onfocus=onenter(this) value=express>
    <input  onblur=onexit(this)  class="in" onfocus=onenter(this) value=express>
    <input  onblur=onexit(this)  class="in" onfocus=onenter(this) value=express>
    <input  onblur=onexit(this)  class="in" onfocus=onenter(this) value=express>
    <input  onblur=onexit(this)  class="in" onfocus=onenter(this) value=express>
    <input  onblur=onexit(this)  class="in" onfocus=onenter(this) value=express>
    <input  onblur=onexit(this)  class="in" onfocus=onenter(this) value=express>
    <input  onblur=onexit(this)  class="in" onfocus=onenter(this) value=express>
    </td>
</table>
</body>
</html>

 

本文关键:事件处理
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top