동적으로로드되는 DIV의 특정 필드에 포커스를 설정하는 적절한 방법은 무엇입니까?동적으로로드 된 DIV의 필드에 포커스 설정
$("#display").load("?control=msgs"); // loads the HTML into the DIV
$('#display').fadeIn("fast"); // display it
$("tex#header").focus(); // ?? neither that
$("input#header").focus(); // ?? nor that
$('#display', '#header').focus() // ?? nor that
$("#header").focus(); // ?? nor that works
다음 HTML은 display
DIV로 가져올 수 있습니다 :
<div id="display">
<form id="newHeaderForm" class="dataform" action="/" method="post">
<input id="to" type="hidden" value="22" name="to"/>
<dl>
<dt>Header</dt>
<dd>
<input id="header" class="large" type="text" name="header" value="" maxlength="128"/>
</dd>
</form>
</div>
많은, 많은 감사합니다!
생성 된 html도 표시 할 수 있습니까? – Bela
$ ('# display', '#header'). focus()가 작동해야합니다. – orip