+ 1

How can I Make the background color of the white buttons change color when clicked on any one color and click a button?

https://code.sololearn.com/WPXKz1IAUcxV/?ref=app

28th Jun 2018, 5:29 PM
B.D
B.D - avatar
3 Answers
+ 4
function changeColor(a) { document.getElementById("cell" ).style.background =a; } First of all Learn difference between class and id, you are using id multiple times which is wrong it will hit only first one and leave the rest. Use class instead.
28th Jun 2018, 5:46 PM
áŽ‹á”˜âżá”ƒËĄ
áŽ‹á”˜âżá”ƒËĄ - avatar
29th Jun 2018, 12:54 AM
CalviŐČ
CalviŐČ - avatar
+ 1
thanks
29th Jun 2018, 8:07 AM
B.D
B.D - avatar