Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let click = 1;
  2. let clicked = 1;
  3.  
  4. function growingWord() {
  5.   let growingWord = document.getElementsByTagName('p')[2];
  6.  
  7.   if (click === 1) {
  8.     growingWord.setAttribute('style', `color:blue; font-size: ${clicked *= 2}px`);
  9.     click = 2;
  10.   } else if (click === 2) {
  11.     growingWord.setAttribute('style', `color:green; font-size: ${clicked *= 2}px`);
  12.     click = 3;
  13.   } else if (click === 3) {
  14.     growingWord.setAttribute('style', `color:red; font-size: ${clicked *= 2}px`);
  15.     click = 1;
  16.   }
  17. };
  18. solve();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement