jQuery 在下拉菜单上找不到我的自定义属性 我有一个类似的属性,仅在其上方一行,效果很好,但这一直给我一个未定义的属性。
jQuery
$('#admin_student_school_select').change('click',function(){
var school_student = $(this+':selected').attr('school_student');
$('#admin_student_content_details')
.html(ajax_load)
.load(loadUrl,"form_being_submitted=admin_page_list_student&school="+school_student);
});
HTML
<select id="admin_student_school_select">
<option>Select a School</option>
<option school_student="1">Riverside Community College</option>
<option school_student="2">Victor Valley College</option>
<option school_student="3">Cal State San Bernardino</option>
<option school_student="4">Craffton College</option>
<option school_student="5">San Bernardino Community</option>
</select>
ajax 调用背后的脚本有效。我已经回应了结果。