Linked Questions
45 questions linked to/from Using jQuery to test if an input has focus
150
votes
4
answers
218k
views
Javascript/jQuery detect if input is focused [duplicate]
How do I detect when .click event triggers if textarea is already focused?
I have this jquery:
$(".status").on("click","textarea",function(){
if ($(this) == "focused") {
// fire ...
1
vote
6
answers
33k
views
Check textbox focus using jQuery [duplicate]
Possible Duplicate:
Using jQuery to test if an input has focus
I need to check if a particular textbox has the focus or not using jQuery. So my code is like this, but it is not working:
if (...
3
votes
3
answers
8k
views
How to get input has focus or not using jquery [duplicate]
How to get input tag of html has focus or not using jquery
keydown event will work for form if input,image etc. tag has focus. but it will not work it focus is on form but not on any tags like input,...
0
votes
1
answer
997
views
Check if input field has focus and pass input variable to function [duplicate]
I have an input field which will be updated every x seconds:
<input type="number" name="METER" id="METER.NUM" min="0" max="500" step="0.10" oninput="setMeter(currentValue);" >
Now, I want to ...
-2
votes
2
answers
522
views
How to test elemnt has focus or not [duplicate]
Possible Duplicates:
How to get input has focus or not using jquery
Using jQuery to test if an input has focus
Hi i want to test Input tag has focus or not using jquery
if(document....
2
votes
1
answer
273
views
jQuery: is an element in focus? [duplicate]
Possible Duplicate:
Using jQuery to test if an input has focus
I have an input element, and I'd like to ask if it is currently in focus without modifying what is already in focus.
0
votes
1
answer
70
views
jQuery ignoring second condition [duplicate]
I've written a jQuery function which I intended to check when shift key is pressed specifically when a certain element has focus.
Below is the code I have written
$(document).keyup(function (e) {
...
394
votes
8
answers
415k
views
How to get the focused element with jQuery?
Using jQuery, how can I get the input element that has the caret's (cursor's) focus?
Or in other words, how to determine if an input has the caret's focus?
219
votes
5
answers
330k
views
How can I check if my Element ID has focus? [duplicate]
Let's say I have the following div that gets focus after a certain condition is met:
<div id="myID" tabindex="-1" >Some Text</div>
I want to create a handler that checks whether or not ...
64
votes
8
answers
92k
views
How to select an element that has focus on it with jQuery
How can you select an element that has current focus?
There is no :focus filter in jQuery, that is why we can use something like this:
$('input:focus').someFunction();
46
votes
10
answers
70k
views
Is there a 'has focus' in JavaScript (or jQuery)?
Is there something I can do like this (perhap via a plugin)
if ( ! $('form#contact input]').hasFocus()) {
$('form#contact input:first]').focus();
}
Basically, set focus to the first input, but only ...
35
votes
5
answers
20k
views
Action on blur except when specific element clicked with jQuery
There are two elements in play:
$('#myInput') // an input field for search
$('#myList') // a list to display search results
I want to hide the list when the input no longer has focus, like so:
$('#...
22
votes
1
answer
22k
views
How to check if a dom element is focusable? [duplicate]
Many DOM elements are focusable: divs with tabIndex, input elements, etc. Is there any simple way to check whether an element is focusable than checking a zillion of different cases? Is there a jQuery ...
7
votes
4
answers
5k
views
How do I test which element has the focus in Selenium RC?
How do I test which element has the focus in Selenium RC?
6
votes
1
answer
3k
views
Karma Test Cases : focus event
I am testing a focus event in angularjs using karma test cases. But the element is not getting focused. Right after I do element.focus() and check if the element
is focused, I get false. And document....