초보자 용으로 불편을 끼쳐 드려 죄송합니다.하지만 답변을 찾기 위해 노력했지만 지금은 전문 지식이 필요하다고 생각합니다.jQuery 포커스() 및 자동 키프레스()
"li을 클릭하면 li에 쓰여진 텍스트가 검색 상자 (ID '# input #)에 표시되고 자동으로 요청이 시작됩니다."
내 스크립트가 제대로 작동하지만 요청/검색이 시작되지 않았습니다. 프로세스의 마지막 단계에서 차단되었습니다.
도움 주셔서 감사합니다.
HTML
<ul id="test">
<li>Hello world</li>
<li>Hello world 2</li>
</ul>
자바 스크립트, JQuery와
<script type="text/javascript">
$(document).ready(function(){
$("#test li").click(function(){
varindex = $(this).text();
$('#input').val("Text is in the search box!"+" "+varindex);
});
});
</script>
<script type="text/javascript">
$(document).ready(function(){
$("#test li").click(function(){
$('#input').focus();
$('#input').trigger(jQuery.Event('key', {which: 13}));
});
});
</script>
당신을인가 입력에서 형태? –
전체 html을 게시 할 수 있습니까? –
양식을 제출 하시겠습니까? 여기를 참조하십시오 : http://stackoverflow.com/questions/1200266/submit-a-form-using-jquery – JohnB