how can focus on first input i开发者_开发百科n active content when it changed ?
$( ".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.
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);
精彩评论