each
과 change
을 jQuery와 결합하고 싶습니다.jQuery each and combined combine
$(document).ready(function() {
$('.doetmee').each(function() {
var thisval = $(this).val()
if(thisval == 'ja')
{
$(this).parent().parent().find('.facebookadv').attr('disabled',false);
}
else
{
$(this).parent().parent().find('.facebookadv').attr('disabled',true);
$(this).parent().parent().find('.facebookadv').val('');
}
$('.doetmee').change(function(){
if(thisval == 'ja')
{
$(this).parent().parent().find('.facebookadv').attr('disabled',false);
}
if(thisval == 'nee' || thisval == 'leeg')
{
$(this).parent().parent().find('.facebookadv').attr('disabled',true);
$(this).parent().parent().find('.facebookadv').val('');
}
});
});
});
그것은 단지 1 시간을 변경하고 그 후이 작동하지 않습니다
이
내 코드입니다.변경할 때마다 어떻게 작동하는지 어떻게 확인할 수 있습니까?
나는 stackoverflow 또는 google에서 찾을 수 있지만 성공하지 못한 많은 것들을 시도했다.
값이 비활성화해야합니다 페이스 북에 선택 leeg
또는 nee
경우
변경 이벤트 외부에서 'var thisval = $ (this) .val()'을 (를) 선언하고 있습니다. 변경 이벤트 내에서 값을 추가해보십시오. – haxxxton
$ ('. doetmee')를 바꿉니다. change (function() {... with $ (this) .change (function –