Given that
- The Browser has a page loaded with an exisitng field (call it ef) with tabindex=1,
- Two new fields are inserted via bookmarklet (nf1 and nf2)
'first time' (incorrect behavior) When the mouse is clicked on nf1 followed by a tab the focus acts as if the tab was entered from field ef and goes to a place other than nf2.
'second time' (correct behavior) Now, if the same actions were repeated i.e. mouse clicked on nf1 followed by a tab the focus goes to nf2.
One way I've ensured that the focus goes to nf2 from nf1 the "first time" around is to hardcode tabindex values to fields nf1 and nf2. But this is suboptimal as one needs to make sure that there are no tabindex conflicts i.e. if there are two fields where tabindex=1 than focus goes from one to the other instead of to the proximate tabindex=2
So, what can be done to ensure that the behaviour that manifests on the "second time" manifests on the first time.
ps: jquery is available on the page (if that helps.)