Home  >  Article  >  Web Front-end  >  Jquery焦点与失去焦点示例应用_jquery

Jquery焦点与失去焦点示例应用_jquery

WBOY
WBOYOriginal
2016-05-16 16:45:14854browse
复制代码 代码如下:

$(function(){
$("#input").focus(function(){//#input换成你的input的ID
//这里写获得焦点之后运行的代码。
}).blur(function(){
//$(".scroll-question").css("display","none");
});
})

})

live要1.4才支持,以下ie,firefox都没问题
复制代码 代码如下:





无标题文档

");
}
);
//失去焦点以后
$("#nameInVal").live("blur",function()
{
alert('nameInVal已失去焦点');
}
);
}
);






1
Before




Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn