【问题标题】:How to dynamically set focus to next text box in ui:repeat如何动态地将焦点设置到 ui:repeat 中的下一个文本框
【发布时间】:2010-10-25 20:17:11
【问题描述】:

在那个按钮之后我有一个文本框。如果我动态单击该按钮,我会再获得一个文本框,但焦点不会出现在新文本框上。任何人都可以提出一些建议。

提前致谢 文卡特

【问题讨论】:

    标签: javascript jsf jquery-plugins focus


    【解决方案1】:

    您需要在插入新的 texbox 后对其执行 element.focus() 以使其获得焦点。

    例如

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

    在 jQuery 中也可用

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

    【讨论】:

      猜你喜欢
      • 2012-03-11
      • 1970-01-01
      • 2018-07-18
      • 2020-06-04
      • 2014-04-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多