Jquery where is focus
Tom aka Sparky Tom aka Sparky 70 2 2 silver badges 11 11 bronze badges. Travis Heeter Travis Heeter Pudugurthi Ravindar Pudugurthi Ravindar 11 5 5 bronze badges.
Basel Issmail 2, 6 6 gold badges 16 16 silver badges 30 30 bronze badges. Sandeep Singh Sandeep Singh 1 1 1 bronze badge. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password.
Post as a guest Name. Email Required, but never shown. The Overflow Blog. Does ES6 make JavaScript frameworks obsolete? Podcast Do polyglots have an edge when it comes to mastering programming Featured on Meta. Now live: A fully responsive profile. Visit chat. Linked See more linked questions.
Related Hot Network Questions. Question feed. Save Article. Improve Article. Like Article. Last Updated : 03 Aug, Previous JavaScript Focus. Next JQuery Set focus on a form input text field on page load. Recommended Articles. Article Contributed By :. Easy Normal Medium Hard Expert. Writing code in comment? You might try creating an example not using jQuery and report it to Edge.
I did too - until I realized I was using Chrome Using Edge, I get consistent results. And you must refresh the page per komarovalexander 's report to see the reported behavior. But DOM calls seem to indicate the element has focus. Perhaps this is what you meant by reporting it to Edge? I don't know if I got the "translation" to non-jquery correct, though. Also strange? We've seen iframe-related focus problems with IE in the past, maybe Edge inherited those.
Do what you did, then refresh the page. It seems like the issue the OP is reporting may be due to that Edge does not "fully" set focus to the input element after the page has been reloaded using the browser's "Refresh" button.
When the page is reloaded using the browser's "Refresh" button it appears that the document is not given focus, as seen by probing document. It is not necessarily causing the issue the OP reports, but may contribute to some confusion. Unfortunately, those two code paths return different values for the same element under some circumstances in particular for.
Here is the sample that demonstrates this - I provide it, not as a fiddle to avoid any iframe issues coming into play, as code you have to save to a file and load in Edge. And Sizzle's notion does not correspond to Edge's notion, which I think is an issue. For sample code demonstrating the issue, see preceding comment above comment. Condition: using Edge and page must be reloaded by using browser's "Refresh" button.
Note, the page must be reloaded using browser's "Refresh" button to demonstrate the issue. Assume the document has an input element inputWithFocus such that inputWithFocus.