페이지에 여러 개의 버튼이 있으며 다음 버튼을 클릭하여 시뮬레이션하고 싶습니다.jQuery 다음 버튼 클릭
$('input, select').keydown(function(e){
if(e.which == 13)
//$('input[type*=button]').click();
$(this).next('input[type*=button]').click();
});
HTML은 :
<tr>
<td class="cell">
<input type="text" name="domain" class="entryfield" value="http://">
</td>
</tr>
<tr>
<td class="cell" align="right" colspan="2">
<input type="button" class="button" value="Get IP" id="submitDomain"/>
</td>
</tr>
주석으로 코드가 작동하지만, 그 페이지의 모든 버튼을 클릭합니다.
감사합니다. 감사합니다. 여기처럼
$(this).next().click();
:
이 –
헤이 @AndrewWhitaker, 당신은 좀 더 제발 설명 할 수 있을까? .parents()를 사용해야합니까? – Prash
다음 버튼을 찾으려고합니다. 그러나'next ('somethinghere')'만이 조건문입니다. 자동으로 다음 버튼을주지는 않습니다. 다음 버튼이 * 버튼이면 다음에 수행됩니다. – Marnix