我试图计算获得的分数并希望它显示在表格中。与在 javascript 中一样,我所做的计算如下:
<script>
function kira1() {
var myeBook = document.getElementById('eBook').value;
var result = document.getElementById('result1');
var myResult = myeBook * 3;
result.value = myResult;
}
function kira2() {
var mybukuTeks = document.getElementById('bukuTeks').value;
var result = document.getElementById('result2');
var myResult = mybukuTeks * 3;
result.value = myResult;
}
function kira3() {
var mymodul = document.getElementById('modul').value;
var result = document.getElementById('result3');
var myResult = mymodul * 2;
result.value = myResult;
}
function kira4() {
var myjurnal = document.getElementById('jurnal').value;
var result = document.getElementById('result4');
var myResult = myjurnal * 2;
result.value = myResult;
}
function kira5() {
var myePembelajaran = document.getElementById('ePembelajaran').value;
var result = document.getElementById('result5');
var myResult = myePembelajaran * 1;
result.value = myResult;
}
function kira6() {
var myinovasi = document.getElementById('inovasi').value;
var result = document.getElementById('result6');
var myResult = myinovasi * 1;
result.value = myResult;
}
function kira7() {
var a = document.getElementById('result1').value;
var b = document.getElementById('result2').value;
var c = document.getElementById('result3').value;
var d = document.getElementById('result4').value;
var e = document.getElementById('result5').value;
var f = document.getElementById('result6').value;
var result = document.getElementById('jumlah_1A');
var myResult = a + b + c + d + e + f;
result.value = myResult;
}
</script>
但是当我尝试运行它时,总数没有按我想要的那样显示。
总数应显示在“Jumlah Skor 1A”