try to add :first because class it's counfiuse what element want to focus
maybe element that has class more than one.

On Thu, May 3, 2012 at 11:25 PM, Greg Moser <[email protected]> wrote:

> I need to add some simple code to focus on an input once a dropdown is
> clicked.  Basically something like this:
>
> jQuery('.dropdown-toggle').click(function(e){
> jQuery(this).parent().find('.myinput').focus();
> });
>
> However this isn't working for me...  If I just console log the
> jQuery(this).parent().find('.myinput') I do infact get the correct input
> I'm looking for however the .focus() command isn't working.  My only
> assumption is that the actual JS that makes the dropdown work, is happening
> after this and calling a focus of its own... so how can i tie into the
> 'after' of that event?
>
> -Greg
>

Reply via email to