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>热门推荐
6 入学校简短祝福语
10 上级买车祝福语大全简短
11 送给员工美好祝福语简短
12 给舍友送祝福语简短
13 毕业英语祝福语大全简短
14 兔年祝福语简短100字
15 侄儿生日祝福语简短独特
16 冬季祝福语大全 简短的
17 儿子31岁祝福语简短
18 圣诞简短祝福语给父母