JavaScript 中 onfocusout 事件有什么用?
onfocusout 事件会在元素失去焦点时触发。你可以尝试运行以下代码,来了解如何在 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>
广告
数据结构
网络
关系数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP