Set focus to field in dynamically loaded DIV

前端 未结 10 1233
心在旅途
心在旅途 2020-12-08 04:26

What is the proper method to set the focus to a specific field within a dynamically loaded DIV?

$(\"#display\").load(\"?control=msgs\"); // loads the HTML in         


        
10条回答
  •  情书的邮戳
    2020-12-08 04:38

    $("#display").load("?control=msgs", {}, function() { 
      $('#header').focus();
    });
    

    i tried it but it doesn't work, please give me more advice to resolve this problem. thanks for your help

提交回复
热议问题