In the past I distinguished between true and triggered events via the e.clientX property (a triggered event has no such property). Not sure if it's the same with focus events (especially since you're calling elem.focus and there is no elem.click) and if there is a better way...
--Klaus On 6 Apr., 04:24, bob <xoxeo...@gmail.com> wrote: > Hi, > <form> > Name: <input type="text" id="my_name" name="my_name"> > </form> > > Is it possible to tell apart focus event? > > jQuery("#my_name").focus(function (evt) { > > if( ??? ){ > > //execute this if focus was triggered by user clicking on the > text > field > } > else { > //execute this if focus was triggered by method call like this > //document.getElementById("my_name").focus(); > > } > > }); > >