내 양식에는 CheckBox
이 있고 CheckBox에 레이블이 있습니다. Firefox & IE9에서 CheckBox change event
은 예상대로 작동하지만 IE8 & IE7에서는 레이블을 클릭 할 때 이벤트가 발생하지만 확인란은 표시하지 않습니다.레이블을 클릭하면 '변경'체크 박스가 작동합니다. ie8, ie7
내 HTML
<div class="item-container">
<div class="label-container">
</div>
<div class="textbox-container">
<input id="AddNewProductCategory" class="" type="checkbox" width="20px" height="20px"
value="1" name="addnewproductcategory" tabindex="1900" />
</div>
<div class="after-checkbox-label">
<label class="Verdana11-424039" for="AddNewProductCategory">
Add New Service Category</label>
</div>
</div>
내 jQuery를 그냥 미래의 참조에 대한
jq('#AddNewProductCategory').change(function(){
jq('#CategoryName').next('label[for=CategoryName]').remove();
jq('#Category').next('label[for=Category]').remove();
if (!jq('#AddNewProductCategory').is(':checked')) {
alert("in change");
jq('input[name="newcategory"]').val('');
jq('#CategoryName').hide();
jq('#store_category').hide();
jq('#Category').removeAttr('disabled');
}
else {
jq('#Category').attr('disabled', 'disabled');
jq('#CategoryName').show();
jq('#store_category').show();
}
});
당신이 JQuery와의 어떤 버전이 있습니까 :
원래
여기 JQ의 이전 버전을 사용하는 사람들을 위해 기존의 코드는 (사용되지 않음)? –
jquery versoin 1.3.2 –
이 문서에 따르면 http://api.jquery.com/change/ : "jQuery 1.4부터는 다른 최신 브라우저의 이벤트와 일관되게 동작하는 Internet Explorer에서 변경 이벤트가 발생합니다." jquery 버전 변경을 고려하십시오. –