开发者

How to dynamically set focus to next text box in ui:repeat

I 开发者_JAVA技巧have one text box immediately after that one button. If i click on that button dynamically i get one more text box, but the focus is not coming to new text box. Can any one suggest something.

Thanks in advance Venkat


You need to execute element.focus() on the new texbox after its insertion to give it focus.

E.g.

var element = document.getElementById('newElementId');
element.focus();

Also available in jQuery

$('#newElementId').focus();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜