I need a javaScript coder
Budget: $10 – $30 CAD
You're free to update the HTML and CSS files if you feel it's necessary. However, the only thing you will need to modify on the HTML is the loading of the JavaScript file to ensure that it loads in the appropriate time frame.
Add a single event listener (not a loop that adds 1 event listener to each div, just 1 event listener total! Delegate the event) that will listen for clicks on any of the colour divs on the page and invoke a function on click.
Add a colour picker to the page using HTML or JavaScript. Your colour picker can use a list of HTML named colours in a dropdown menu or a "color" input.
When a colour div is clicked do the following:
Set the background colour of the clicked colour div to the colour value set in the colour-picker input, if there is one. If there is no colour selected, use the provided randomColor() function to generate a random colour.
Add a data attribute to each of the colour the divs, called data-colored so that you can easily track whether or not the div has been coloured.
If a colour div has already been coloured, it should not be coloured again.
Add the colour name, or number, to the coloured div as text, that corresponds to the background colour that was assigned to it.
After the coloured div has been coloured, clear the input, so that it's ready for new input.
Once all the divs have been coloured (ie. clicked), pop up an alert indicating that the page has been completely coloured.
Notice that the Javascript file is being loaded in the head of the HTML. You may need to wait until all the DOM content is loaded before adding your event listener.
Add a single event listener (not a loop that adds 1 event listener to each div, just 1 event listener total! Delegate the event) that will listen for clicks on any of the colour divs on the page and invoke a function on click.
Add a colour picker to the page using HTML or JavaScript. Your colour picker can use a list of HTML named colours in a dropdown menu or a "color" input.
When a colour div is clicked do the following:
Set the background colour of the clicked colour div to the colour value set in the colour-picker input, if there is one. If there is no colour selected, use the provided randomColor() function to generate a random colour.
Add a data attribute to each of the colour the divs, called data-colored so that you can easily track whether or not the div has been coloured.
If a colour div has already been coloured, it should not be coloured again.
Add the colour name, or number, to the coloured div as text, that corresponds to the background colour that was assigned to it.
After the coloured div has been coloured, clear the input, so that it's ready for new input.
Once all the divs have been coloured (ie. clicked), pop up an alert indicating that the page has been completely coloured.
Notice that the Javascript file is being loaded in the head of the HTML. You may need to wait until all the DOM content is loaded before adding your event listener.