blur()在chome中不起作用? [英] blur() not working in chome?

查看:121
本文介绍了blur()在chome中不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在做一个简单的自动填充文本框示例,每当我在文本框中键入任何内容时,它都会向我显示现有选项,因为我们知道自动填充文本框的默认功能.现在,我需要在从自动完成列表中选择的选项之一(位于文本框下方)时执行模糊功能,以便焦点应远离文本框.

我已经尝试过 document.getElementById(''text1'').blur(),但是它在chrome和safari中不起作用.

有谁知道如何执行此操作或以其他任何方式完成此操作?

我不想使用jQuery.


在此先感谢!!!!!

问候

Hello Guys,

I am doing a simple example of autocomplete textbox.Well whenever I am typing anything in the textbox it shows me the existing options as we know the default functionality of autocomplete textbox. Now I need that when I select one of the options from the autocomplete list droping below the textbox the blur function should execute so that the focus should get away from the textbox.

I have tried document.getElementById(''text1'').blur() but it is not working in chrome and safari.

Do anyone have any idea how to do this or any other way to accomplish this?

I do not want to do this using jquery.


Thanks in Advance!!!!!

Regards,

推荐答案

冒泡的冒口类似物是DOMFocusOut(Opera,Safari/Chrome)和focusout(IE).
参考: http://javascript.info/tutorial/focus-blur [
The bubbling analogs for blur are DOMFocusOut (Opera, Safari/Chrome) and focusout (IE).
Ref:http://javascript.info/tutorial/focus-blur[^]


这篇关于blur()在chome中不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆