Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Conversation

@anthonythuo2320
Copy link

No description provided.

Copy link

@Happy0 Happy0 left a comment

Choose a reason for hiding this comment

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

Good work. You've shown a good understanding of manipulating DOM elements and using helper functions / for loops and if statements.

// 2. Define your event handler (callback <-- function)
myButton.addEventListener('click', doSomething);

function doSomething(){
Copy link

Choose a reason for hiding this comment

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

You could rename this function to something describing what it does.

Maybe 'changePageElementColours' or something :P

function changeFontColor(element, colour) {
element.style.color = colour;
}
function jumbotronColor(element, colour) {
Copy link

Choose a reason for hiding this comment

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

You aren't using this function. Maybe you don't need it and it can be removed?

@@ -0,0 +1,44 @@


function changeBackgroundColour(element, colour, ) {
Copy link

Choose a reason for hiding this comment

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

the ',' after colour is not valid javascript. Maybe it breaks your function?


}
var myButtons = document.querySelectorAll('.colorButton');
for (var i = 0; i < myButtons.length; i++) {
Copy link

Choose a reason for hiding this comment

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

Ha :). Nice use of a for loop and if statements in the 'changeColor' function.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants