【发布时间】:2011-10-06 01:17:20
【问题描述】:
可能的重复:
How to get input has focus or not using jquery
Using jQuery to test if an input has focus
你好我想测试输入标签是否有焦点使用 jquery
if(document.getElementById('Department').focus())
我正在使用。但它行不通,它总是会给我假的。 请帮我解决这个问题
【问题讨论】:
-
你今天早些时候不是已经问过这个了吗? stackoverflow.com/questions/6703862/…
-
如果你使用 jQuery,你可以使用
$('#Department')代替document.getElementById('Department')参见 api.jquery.com/id-selector 和其他选择器。 -
是的,我也问过同样的问题。
-
@Roayl:您的问题被关闭出于某种原因。已经在这里提出并回答了:stackoverflow.com/questions/967096/… 如果社区关闭了您的问题,请不要重新发布。见the FAQ。
标签: javascript jquery html