Javascript专注于Firefox中的TextBox [英] Javascript to focus on the TextBox in Firefox

查看:63
本文介绍了Javascript专注于Firefox中的TextBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在使用Javascript检查邮件事件。

它的工作正常,但问题是在我调用的时候使用 Onblur 的功能焦点功能不起作用。



脚本是:

Hi ,

I am using Javascript to check mail event.
Its working fine, but the problem is while I am invoking the function using Onblur the focus function is not working.

Script is:

document.getElementById('txtEmail').focus();



当我在 Onblur上使用它时,在FireFox 13中不起作用

在IE中它正在工作。


Is not working in FireFox 13, when I use it on Onblur.
In IE it is working.

推荐答案

Hi Sarat,



请尝试这样做可行。



Hi Sarat,

Please try like this this may work.

var elem = document.getElementById("focusID2");
if (elem != null) {
   elem.focus();





我建议你查看以下链接。

焦点的演示链接()



谢谢



I would like to advise you to look into the following link.
Demo link for focus()

Thanks


这篇关于Javascript专注于Firefox中的TextBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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