내가하려는 일은 다음의 제출 버튼을 클릭하는 것과 같은 결과를 얻는 것입니다. document.getElementsByName는 '이' 가 어떻게이 문제를 해결할 수있는 버튼 제출과 같은 결과 을 반환하지 않습니다처럼'this'라는 단어를 사용하지 않고 자바 스크립트에서 'this'객체 가져 오기
$('.NextButton').click(function() {
dex.forms.form_ajax_submit(document.getElementsByName('submit_http:'),
function(res) {
alert('posting failed');
},
function(res) {
alert('posting success');
});
});
을하지만 보이는 :
<input id="submit_http:" class="add_submit" type="button" onclick="return dex.forms.form_ajax_submit(this,function(res) { alert('posting failed'); },function(res) { alert('posting success'); });" value="Next" name="submit_http:">
나는 그런 식으로 일을하려고했다 ?
: 이미 추천 더 정확한 기능을
또는 사용
중 하나를 사용하여 배열의 첫 번째 요소에 액세스 '? –
왜냐하면 "submit"버튼과 관련이 없기 때문에 "NextButton"에 대해 사용하지 않기 때문입니다. – DanR
document.getElementsById로 확인합니까? – MCSI