(1) //'#grade dropdownlist 的id
// parseInt() 将字符传转换为数字
//toFixed()保留小数点位数
//$('#Span1').html()给span加入数据
$('#grade').on("change",
function () {
var grateTole = $("#grade option:selected").val(); //获取dropdownlist 里面选中的值
$('#totalSore').html(grateTole);
var percent = parseInt(grateTole) / 30 * 100;
$('#Span1').html(percent.toFixed(2) + '%');
})
(2)RadioButton选中值
//radNOPass RadioButton 的id
$(function () { if (document.getElementById("radNOPass").checked) {//判断是否选中 $('#divNoPass').show(); $('#txtNoPassReason').show(); } else { $('#divNoPass').hide(); $('#txtNoPassReason').hide(); } });
转载请注明原文地址: https://ju.6miu.com/read-664016.html