Commit 23663284 authored by Sander Kvenild's avatar Sander Kvenild
Browse files

Fixed broken checkboxes

parent 908153d7
......@@ -37,7 +37,6 @@ function print(string) {
output.innerText += string + "\n";
}
// TODO: Fortsett fra oppgave 5
function tre_kontoer() {
output.innerText = "";
let lise = new barnekonto(12345678, "Lise Jensen");
......@@ -65,8 +64,13 @@ function tre_kontoer() {
let saldos = document.getElementsByName("saldo");
let checkboxes = document.getElementsByName("check");
for (i = 0; i < checkboxes.length; i++) {
checkboxes[i].onchange = () => {
saldos[i].disabled = checkboxes[i].checked
}
// TODO: Convert to loop
checkboxes[0].onchange = () => {
saldos[0].disabled = checkboxes[0].checked;
}
checkboxes[1].onchange = () => {
saldos[1].disabled = checkboxes[1].checked;
}
checkboxes[2].onchange = () => {
saldos[2].disabled = checkboxes[2].checked;
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment