라디오 입력의 모든 흐림이나 클릭 또는 초점 이벤트에서 라디오 입력 값을 확인하고 싶습니다.배열에서 jQuery bind 또는 addEventListener를 사용하는 방법은 무엇입니까?
function getCheckedVal(){
var checked = $('#education_number input:radio:checked')
console.log(checked.val());
};
이되어 있지 작품 :
window.onload = function(){
var radio = $('#education_number input:radio');
for(var i=0; i<radio.length; i++){
radio[i].addEventListener('blur', function(){getCheckedVal()});
};
}
그리고 이것은 예외가 인상이다
window.onload = function(){
var radio = $('#education_number input:radio');
for(var i=0; i<radio.length; i++){
radio[i].bind('blur', getCheckedVal());
};
}
Uncaught TypeError: Object #HTMLInputElement has no method 'bind'
어떻게 그렇게 할 수 있습니까?
답변과 올바른 질문에 감사드립니다. – I159