| 目次 |
|---|
|
・focus() ・ソースサンプル ・実行例 |
input要素がフォーカスを得た時に実行されます。
<html>
<head>
<title></title>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">google.load("jquery", "1.3");</script>
<script type="text/javascript">
$(document).ready(function(){
$("#textfield2").focus(function(){
alert("focus!");
});
});
</script>
</head>
<body>
<input type="text" value="textfield2" id="textfield2" />
</body>
</html>
以下テキストフィールドにフォーカスをあててください。