2013年8月26日 星期一

javascript-lostfocus




inf :  http://www.w3schools.com/jsref/event_onblur.asp


<!DOCTYPE html>
<html>
<head>
<script>
function myFunction()
{
var x=document.getElementById("fname");
x.value=x.value.toUpperCase();
}
</script>
</head>
<body>

Enter your name: <input type="text" id="fname" onblur="myFunction()">

<p>When you leave the input field, a function is triggered which transforms the input text to upper case.</p>

</body>
</html>

沒有留言:

張貼留言