sadeghhp
sadeghhp

Reputation: 702

Jquery UI Accordion focus on focus first input in active content

how can focus on first input in active content when it changed ?

Upvotes: 0

Views: 2489

Answers (2)

Halil Özgür
Halil Özgür

Reputation: 15945

$( ".selector" ).accordion({
    activate: function(event, ui) {
        $(ui.newPanel).find("input:first").focus();
    }
});

Originally answer was based on the jQuery Accordion Demo, but the API has changed in the meantime.

Upvotes: 2

carolina
carolina

Reputation: 1

I'm working with JQuery UI control and I had a trouble with focusing the first input of my page. Here is the solution:

setTimeout(function () { $("#dvCreateItem").find("input:first").focus(); }, 1000);

Upvotes: 0

Related Questions