JavaScript 中 onfocusout 事件的用法是什麼?
onfocusin 事件會在元素失去焦點時觸發。你可以嘗試執行以下程式碼瞭解如何在 JavaScript 中實現 onfocusout 事件。
示例
<!DOCTYPE html>
<html>
<body>
<p>Write below:</p>
<p>After losing focus, the background color of input check will change.</p>
<input type = "text" onfocusout = "newFunc(this)">
<script>
function newFunc(x) {
x.style.background = "blue";
}
</script>
</body>
</html>
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP