0

Can you help me with the code? Change the color of the div element

So i have this array.And I need to change the color of div element every time it loops through settings array and also show color value in the div element.\ var settings=[ {clor:orange, backgroundColor:'#4CAF50',height:'30px',width:'30px'}, {eigth:'150px',color:white, ,width:'90px',backgroundColor:'#2196F3',} {idth:'2000px', height:'200px',color#fbff64, backgroundColor:'#f44336'}, {backgundColor:'196F3'width:'500px',color:heigtt:'320px',color:'black'},]

11th Aug 2017, 12:38 PM
Manik Tafralian
Manik Tafralian - avatar
6 Respuestas
+ 6
can you post a link to your code here?
11th Aug 2017, 1:39 PM
Nomeh Uchenna Gabriel
Nomeh Uchenna Gabriel - avatar
+ 6
You missed many things on both the html, css and javascript ...if it doesn't work on your browser, try the jQuery method! https://code.sololearn.com/WkV4r1tZm9A6/?ref=app
11th Aug 2017, 7:57 PM
Nomeh Uchenna Gabriel
Nomeh Uchenna Gabriel - avatar
0
Yes sure.I'll elaborate a bit and post it
11th Aug 2017, 2:29 PM
Manik Tafralian
Manik Tafralian - avatar
11th Aug 2017, 5:29 PM
Manik Tafralian
Manik Tafralian - avatar
0
Heres is my code.I need to get the color attribute of array element,in this case div element.And when I loop through the array I need to print the color name in div section and with each i++ element printing change the div style on onclick event.I know my description is weird and complicated 😃
11th Aug 2017, 5:33 PM
Manik Tafralian
Manik Tafralian - avatar
0
I know that my code is incomplete.I just wrote basic code to give you idea about the task.The main issue with the code is that I couldnt get nodes with the method I used in the code,mainly when I console logged document.getElementByID.childnodes it had a right output.but when i tried to print value or alter smth it printed like value of null. I want to understand where this null come from.
13th Aug 2017, 4:36 PM
Manik Tafralian
Manik Tafralian - avatar