onBlur:當輸入框失去焦點后 ;
onFocus:當輸入框獲得焦點后;
1、直接在元素的屬性中使用;
<input type="text" id="test" οnblur=" test() " >
2、用 js 綁定事件
<script>
var Test1 = document.getElementById('test');
Test1 .onblur = function(){ //執行的函數 };
</script>
onBlur:當輸入框失去焦點后 ;
onFocus:當輸入框獲得焦點后;
1、直接在元素的屬性中使用;
<input type="text" id="test" οnblur=" test() " >
2、用 js 綁定事件
<script>
var Test1 = document.getElementById('test');
Test1 .onblur = function(){ //執行的函數 };
</script>
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。