Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sander Kvenild
DCST1007 - OOP
Commits
89671141
Commit
89671141
authored
Feb 02, 2022
by
Sander Kvenild
Browse files
Set value to 200 if checkbox is checked
parent
23663284
Changes
1
Hide whitespace changes
Inline
Side-by-side
js-ov12-oop2-sander-kvenild/index.js
View file @
89671141
...
...
@@ -67,10 +67,19 @@ let checkboxes = document.getElementsByName("check");
// TODO: Convert to loop
checkboxes
[
0
].
onchange
=
()
=>
{
saldos
[
0
].
disabled
=
checkboxes
[
0
].
checked
;
if
(
checkboxes
[
0
].
checked
)
{
saldos
[
0
].
value
=
200
;
}
}
checkboxes
[
1
].
onchange
=
()
=>
{
saldos
[
1
].
disabled
=
checkboxes
[
1
].
checked
;
if
(
checkboxes
[
1
].
checked
)
{
saldos
[
1
].
value
=
200
;
}
}
checkboxes
[
2
].
onchange
=
()
=>
{
saldos
[
2
].
disabled
=
checkboxes
[
2
].
checked
;
if
(
checkboxes
[
2
].
checked
)
{
saldos
[
2
].
value
=
200
;
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment