This function creates a circle and adds it to the div contaianer. You can pick any color for it to be by passing it as the parameter. (Made from scratch).
function colorCircle(color) {
const circ = document.createElement('div');
circ.className = 'circ';
circ.style.backgroundColor = color;
document.querySelector('#container').appendChild(circ);
}
colorCircle('royalblue');
const colorCircle = function(color) {
const circ = document.createElement('div');
circ.className = 'circ';
circ.style.backgroundColor = color;
document.querySelector('#container').appendChild(circ);
}
colorCircle('royalBlue');
const colorCircle = color => {
const circ = document.createElement('div');
circ.className = 'circ';
circ.style.backgroundColor = color;
document.querySelector('#container').appendChild(circ);
}
colorCircle('royalBlue');