Sheffield | ITP-Jan-26 | Hayriye Saricicek | Sprint 3 | Quote Generator#1151
Sheffield | ITP-Jan-26 | Hayriye Saricicek | Sprint 3 | Quote Generator#1151mshayriyesaricicek wants to merge 2 commits intoCodeYourFuture:mainfrom
Conversation
jayshreehajgude2012
left a comment
There was a problem hiding this comment.
Nice styling but use externally.
Java script file linked correctly.
DOM methods used correctly.
Resolve Error-quotes array missing.
Sprint-3/quote-generator/index.html
Outdated
| padding: 10px 20px; | ||
| font-size: 16px; | ||
| } | ||
| </style> |
There was a problem hiding this comment.
You can use external CSS file and link it to CSS to make code clean.
There was a problem hiding this comment.
I didn't see the css file that is why I did in html. I have put all styling in css now and linked in the html. Thank you.
| font-size: 16px; | ||
| } | ||
| </style> | ||
| <script defer src="quotes.js"></script> |
There was a problem hiding this comment.
Correctly linked JavaScript file.
Sprint-3/quote-generator/quotes.js
Outdated
| @@ -1,3 +1,20 @@ | |||
| // DO NOT EDIT ABOVE HERE | |||
| window.addEventListener("DOMContentLoaded", () => { | |||
There was a problem hiding this comment.
You used DOMContentLoaded properly
Clean DOM selection
Good use of textContent
Proper event listener used.
You can explore more DOM selection and Event handling methods.
Sprint-3/quote-generator/quotes.js
Outdated
| const newQuoteBtn = document.getElementById("new-quote"); | ||
|
|
||
| function displayRandomQuote() { | ||
| const randomQuote = pickFromArray(quotes); |
There was a problem hiding this comment.
Quote Array is missing look into it.
There was a problem hiding this comment.
I am not sure if you are referring to the qoute array being defined after the function that uses it? I understood that we had to write our code above the line that says do not edit below so that is what I did. Or is there something else that I am missing? Thank you
Self checklist
Changelist
Added a function to enable random quotes to be generated by pressing the new quote buttons.
Added style to the page by updated HTML.