Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 1
    If you and console.log() before $("#email").focus(); above check the console, you will see that you're creating and infinite-loop by doing a .focus as the focusin event fires, resulting in maximum call stack size exceeded error. Commented Jul 11, 2018 at 22:12
  • First... $("#email")[0] is an abomination. You force jQuery to create an object... Then you use its [0], which is the same as document.getElementById("#email"). All more about this element that was added in the jQuery object, you disclose it. -- So that is syntaxically a "doh!" Commented Jul 11, 2018 at 22:13
  • Possible duplicate of Get cursor position (in characters) within a text Input field Commented Jul 11, 2018 at 22:16
  • In the above comment of mine, you disclose it. should have been read you discard it.;) Commented Jul 11, 2018 at 23:16