以下がIE8で機能しないのに、他のすべてのブラウザーでは機能するのはなぜですか。
$(function () {
//add binding to dropdowns
$("#PersonsId").change(function () {
$('option:selected', this).attr('selected', true).siblings().removeAttr('selected');
//set value on hidden text field
if ($(this)[0].selectedIndex > 0) {
$(this).parent().next().val($(this).find("option:selected").text());
}
else {
$(this).parent().next().val("");
}
});
});
たぶんこれは最善の解決策ではないので、これをどのように変更しますか?