Linked Questions

150 votes
4 answers
218k views

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 ...
southpaw93's user avatar
  • 1,961
1 vote
6 answers
33k views

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 (...
user853575's user avatar
3 votes
3 answers
8k views

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,...
Royal Pinto's user avatar
  • 2,931
0 votes
1 answer
997 views

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 ...
Philies's user avatar
  • 243
-2 votes
2 answers
522 views

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....
Royal Pinto's user avatar
  • 2,931
2 votes
1 answer
273 views

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.
Steve's user avatar
  • 4,223
0 votes
1 answer
70 views

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) { ...
Richard's user avatar
  • 96
394 votes
8 answers
415k views

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?
dave's user avatar
  • 15.6k
219 votes
5 answers
330k views

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 ...
Kode_12's user avatar
  • 4,976
64 votes
8 answers
92k views

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();
jQuery Lover's user avatar
46 votes
10 answers
70k views

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 ...
alex's user avatar
  • 492k
35 votes
5 answers
20k views

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: $('#...
Justin Stayton's user avatar
22 votes
1 answer
22k views

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 ...
Konstantin Solomatov's user avatar
7 votes
4 answers
5k views

How do I test which element has the focus in Selenium RC?
hwiechers's user avatar
  • 15.1k
6 votes
1 answer
3k views

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....
Empty's user avatar
  • 350

15 30 50 per page