獲取焦點, 失去焦點

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="Jquery1.7.js" type="text/javascript"></script>
     <script type="text/javascript">
         $(function () {
             $('#Text1').bind({ 'focus': function () { alert('獲取焦點'); }, 'blur': function () { alert('失去焦點'); }, 'keyup': function () { alert($(this).val()) } })
         })
    </script>
</head>
<body>
 <input id="Text1" type="text" />
    <br />
    <input id="Text2" type="text" />
</body>
</html>
發佈了133 篇原創文章 · 獲贊 3 · 訪問量 6萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章