我正在尝试在此处添加只读属性。你能帮我这里的代码,如果选中该框,我的平均行将是只读的吗?
<input type="text" name="average[]" class="average"
id="average_<?php echo $row['student_no']; ?>" value="<?php echo
$row['average_pts']; ?>" >
<input type="checkbox" name="disable[<?php echo $row['student_no']; ?>]" id="disable" value="1" class="disable" <?php if ($row['disable_comp']=='1') { echo "checked=\"checked\""; } ?>>
$(".disable").change(function() {
var val = $(this).val();
if ($(this).is(':checked')) {
var checked = $('input[type=checkbox]').is(':checked');
$("input").unbind('keyup', computeValues);
var checked=$("#able").is(':checked');
}else{
$("input").bind('keyup', computeValues).trigger('keyup');
$("#average").prop('readonly');
}
});