标签:java ref example tco http nta 代码 size frameset
onblur 事件会在对象失去焦点时发生。
onblur="SomeJavaScriptCode"
参数 | 描述 |
---|---|
SomeJavaScriptCode | 必需。规定该事件发生时执行的 JavaScript。 |
<a>, <acronym>, <address>, <area>, <b>, <bdo>, <big>, <blockquote>,
<button>, <caption>, <cite>, <dd>, <del>, <dfn>, <div>, <dl>, <dt>,
<em>, <fieldset>, <form>, <frame>, <frameset>, <h1> to <h6>, <hr>, <i>,
<iframe>, <img>, <input>, <ins>, <kbd>, <label>, <legend>, <li>,
<object>, <ol>, <p>, <pre>, <q>, <samp>, <select>, <small>, <span>,
<strong>, <sub>, <sup>, <table>, <tbody>, <td>, <textarea>, <tfoot>,
<th>, <thead>, <tr>, <tt>, <ul>, <var>
button, checkbox, fileUpload, layer, frame, password,
radio, reset, submit, text, textarea, window
在本例中,我们将在用户离开输入框时执行 JavaScript 代码:
<html>
<head>
<script type="text/javascript">
function upperCase()
{
var x=document.getElementById("fname").value
document.getElementById("fname").value=x.toUpperCase()
}
</script>
</head>
<body>
输入您的姓名:
<input type="text" id="fname" onblur="upperCase()"
/>
</body>
</html>
输入您的姓名:
标签:java ref example tco http nta 代码 size frameset
原文地址:http://www.cnblogs.com/yangwenlong/p/7955638.html