jQuery focusout() 方法

jQuery 教程 · 2019-03-11 08:57:42

实例

当 <div> 元素或其任意子元素失去焦点时,设置 <div> 元素的背景颜色:

$("div").focusout(function(){ $(this).css("background-color","#FFFFFF"); });

定义和用法

当元素(或在其内的任意元素)失去焦点时发生 focusout 事件。

当在元素或在其内的任意元素上发生 focusout 事件时,focusout() 方法添加要运行的函数。

与 blur() 方法不同的是,focusout() 方法在任意子元素失去焦点时也会触发。

提示:该方法通常与 focusin() 方法一起使用。

语法


$(selector).focusout(function)

参数 描述
function 可选。规定 focusout 事件发生时要运行的函数。

点击查看所有 jQuery 教程 文章: https://www.codercto.com/courses/l/35.html

查看所有标签

The Cult of the Amateur

The Cult of the Amateur

Andrew Keen / Crown Business / 2007-6-5 / USD 22.95

Amateur hour has arrived, and the audience is running the show In a hard-hitting and provocative polemic, Silicon Valley insider and pundit Andrew Keen exposes the grave consequences of today’s......一起来看看 《The Cult of the Amateur》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具