Skip to content

Commit

Permalink
adding classList toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
charlyoleg committed May 3, 2020
1 parent cacd172 commit 973cbf0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions frontend/sass/web_blabla_style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ body > main {
background-color: orange;
}

.result2.bgpink,
.result3.bgpink {
background-color: pink;
}



// ============================
Expand Down
1 change: 1 addition & 0 deletions frontend/ts/controllers/addmult_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default class extends Stimulus.Controller {
this.resultTarget.value = res;
this.result2Targets.forEach((item: HTMLParagraphElement, index: number) => {
item.innerHTML = res.toString();
item.classList.toggle("bgpink", res%10==0 );
});
}

Expand Down

0 comments on commit 973cbf0

Please sign in to comment.