Skip to content

Conversation

@lee-kimmixq
Copy link

Please fill out the survey before submitting the pull request. Thanks!

🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀

How many hours did you spend on this assignment? 1 (base)

Please fill in one error and/or error message you received while working on this assignment.
Empty argument for addEventListener

What part of the assignment did you spend the most time on?
reset button

Comfort Level (1-5): 3

Completeness Level (1-5): 3

What did you think of this deliverable?

Is there anything in this code that you feel pleased about?

Copy link

@michelle-mok michelle-mok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work organising your code into functions!
what is the purpose of the onClick(event.currentTarget) for all the buttons?

keep up the good work!

}
}, 100);
}
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work changing button colour on click!

startButton.classList.add('stopwatch-button');
startButton.innerText = 'Start';
startButton.addEventListener('click', (event) => {
onClick(event.currentTarget);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does the onClick do? would your code work without it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the onClick is just to change the colour of the button for 200ms to know that i've clicked on it!

stopButton.classList.add('stopwatch-button');
stopButton.innerText = 'Stop';
stopButton.addEventListener('click', (event) => { modeStop = true;
onClick(event.currentTarget); });
Copy link

@michelle-mok michelle-mok Sep 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would be clearer if written like this :

stopButton.addEventListener('click', (event) => { 
    modeStop = true;
    onClick(event.currentTarget);
 });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants