Skip to content

Sheffield | 26-ITP-Jan | Seti Mussa | Sprint 3 | Quote generator#1197

Open
Seti-Jemal wants to merge 4 commits intoCodeYourFuture:mainfrom
Seti-Jemal:Sprint--3-quote--generator
Open

Sheffield | 26-ITP-Jan | Seti Mussa | Sprint 3 | Quote generator#1197
Seti-Jemal wants to merge 4 commits intoCodeYourFuture:mainfrom
Seti-Jemal:Sprint--3-quote--generator

Conversation

@Seti-Jemal
Copy link
Copy Markdown

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

I have completed the task.

@Seti-Jemal Seti-Jemal added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 13, 2026
Comment thread Sprint-3/quote-generator/quotes.js Outdated
Comment on lines +506 to +511
displayQuote();

// Change quote when button is clicked
document
.getElementById("new-quote")
.addEventListener("click", displayQuote); No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Placing all the "run on load" code in one place is a good practice.
Would be even better to place the code
inside a function to make it clearer that "this is what runs when the page loads."

For examples,

function setup() {
  // code to be executed on page load
}

window.addEventListener('load', setup);

or

window.addEventListener('load', function() {
  // code to be executed on page load
});

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks, I have updated it .

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Apr 14, 2026
@Seti-Jemal Seti-Jemal added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Apr 16, 2026
Comment on lines +497 to +516
function setup() {
const quoteElement = document.getElementById("quote");
const authorElement = document.getElementById("author");


function displayQuote() {
const randomQuote = pickFromArray(quotes);

quoteElement.textContent = randomQuote.quote;
authorElement.textContent = randomQuote.author;
}

// Show a quote when page loads
displayQuote();

// Change quote when button is clicked
document
.getElementById("new-quote")
.addEventListener("click", displayQuote);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Indentation is off. Have you enabled "Format on save" on VSCode?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I've fixed it.

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Apr 16, 2026
@Seti-Jemal Seti-Jemal added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Apr 16, 2026
@cjyuan
Copy link
Copy Markdown
Contributor

cjyuan commented Apr 17, 2026

Look good!

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants